MCP_NODE
by TechMaster1000
Overview
A Node.js gateway that connects AI models (AWS Bedrock) with external tools (Model Context Protocol servers) via a streaming SSE endpoint for real-time, agentic AI applications.
Installation
docker run -d -p 3000:3000 -e AWS_REGION=us-east-1 -e AWS_ACCESS_KEY_ID=your_key -e AWS_SECRET_ACCESS_KEY=your_secret -e BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20241022-v2:0 -e MCP_SERVERS='[{"name":"test","type":"http","url":"http://localhost:8080"}]' mcp-gatewayEnvironment Variables
- PORT
- NODE_ENV
- AWS_REGION
- AWS_ROLE_ARN
- AWS_SESSION_NAME
- BEDROCK_MODEL_ID
- MCP_SERVERS
- LOG_LEVEL
- CORS_ORIGIN
Security Notes
The gateway's `stdio-client` can execute arbitrary commands (`npx`, `command`, `args`) configured via the `MCP_SERVERS` environment variable. While `MCP_SERVERS` is intended for administrative configuration, any compromise of the environment or application could lead to arbitrary code execution on the host where the gateway runs. The `filesystem` MCP server, if configured, explicitly requires 'Full Disk Access' on macOS, exposing a broad attack surface. The gateway does not perform input validation on tool arguments against the tool's schema, relying entirely on individual MCP servers for this, which could be a vulnerability if an MCP server is misconfigured or a malicious prompt bypasses Bedrock's guardrails. No hardcoded secrets were found in the code, and AWS credentials are handled via IAM roles or Secrets Manager, which are good practices for secure credential management.
Similar Servers
MCPJungle
MCPJungle is a self-hosted Model Context Protocol (MCP) Gateway that allows developers to register and manage various MCP servers and their tools from a central location, enabling AI agents to discover and consume these tools from a single gateway.
sample-agentic-ai-demos
Provides various examples for building Agentic AI with AWS Bedrock using the Model Context Protocol (MCP) for tool invocation and inter-agent communication.
emceepee
A proxy server enabling AI agents to dynamically connect to and interact with multiple Model Context Protocol (MCP) backend servers, exposing the full MCP protocol via a simplified tool interface or a sandboxed JavaScript execution environment.
mcp-gateway
Aggregates multiple Model Context Protocol (MCP) servers into a single gateway, providing unified search, description, and invocation for their tools, primarily to mitigate context window limits for AI clients.