MCP_NodeServer
by Bing-Xuan-Lu
Overview
This server acts as a coding agent providing tools to an orchestrating AI for full-stack PHP development, including file system management and direct database interaction.
Installation
node index.jsSecurity Notes
CRITICAL SECURITY VULNERABILITIES DETECTED: 1. Hardcoded Root Database Credentials: The `dbConfig` object explicitly uses `user: 'root'` with an empty password. This is an extremely dangerous practice that grants full administrative access to the database if the server or its configuration is compromised, or if an attacker can trigger database operations. 2. SQL Injection Vulnerability: The `execute_sql` tool directly executes arbitrary SQL provided in `args.sql` without any apparent sanitization or validation. This allows for direct SQL injection attacks, enabling unauthorized data manipulation, schema alteration (e.g., `DROP TABLE`), or data exfiltration if an attacker can influence the tool's input. 3. Path Traversal Vulnerability: File system tools (`list_files`, `read_file`, `create_file`, `apply_diff`) construct file paths by joining a `basePath` with user-provided `relative_path` or `path`. While `path.join` helps normalize paths, it does not inherently prevent directory traversal (`../`) sequences, potentially allowing an attacker to access, create, or modify files outside the intended `D:\Develop` base directory. 4. Powerful Unrestricted Operations: The combination of arbitrary SQL execution and unrestricted file system modification (including creating/overwriting files) makes this server a high-risk component if its inputs are not meticulously validated and authenticated. Given its role as an agent's tool, it's particularly susceptible if the orchestrating AI can be subjected to prompt injection attacks. RECOMMENDATIONS: The hardcoded credentials and direct execution of arbitrary commands (SQL, file system) are critical flaws that must be addressed before deployment. Database credentials and sensitive paths should be moved to environment variables, inputs should be rigorously validated and sanitized, and operations should be restricted with strong access controls.
Similar Servers
generator
Provides a Retrieval-Augmented Generation (RAG) system and Micro-Context Protocol (MCP) server for AI assistants to understand, interact with, and generate documentation/code for projects. It allows indexing codebase knowledge, semantic search, and exposing file system, Git, and code analysis tools to AI agents.
code-buddy
Provides an AI-powered coding companion with comprehensive file system and development tools, integrating with MCP-compatible clients like Claude Desktop.
watercooler-cloud
Facilitates asynchronous collaboration and knowledge management for AI agents by managing markdown-based discussion threads and syncing them via Git, with advanced features for branch parity and knowledge graph generation.
mcp-server
A PHP 8.4 MCP (Model Context Protocol) server designed to expose custom PHP methods as AI tools and resources, facilitating AI agent interaction with data storage systems like Redis, MongoDB, and Memgraph.