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
mcp-proxy
A proxy server that translates Model Context Protocol (MCP) messages from stdio-based backend servers into streamable HTTP and Server-Sent Events (SSE) endpoints.
sample-agentic-ai-demos
This MCP Server (TypeScript SSE demo) demonstrates an interactive chat interface with tool integration, powered by Amazon Bedrock, designed for agentic AI interactions via the Model Context Protocol (MCP/SSE). It provides tools to interact with AWS S3 and retrieve time information.
aap-mcp-server
A Model Context Protocol (MCP) service that provides access to Ansible Automation Platform (AAP) APIs through OpenAPI specifications.
sample-ecs-mcp-server
Deployment of an Agentic AI architecture on AWS Fargate using Amazon ECS, connecting to multiple Model Context Protocol (MCP) servers for tool execution.