shared-mcp-proxy
Shared MCP proxy infrastructure that runs MCP servers once on the host machine and exposes them via SSE to multiple Docker containers and AI CLI tools. Eliminates memory-wasteful duplication (N containers × M CLIs × K MCPs).
Architecture
- mcp-proxy runs on host (port 9902), manages stdio MCP servers
- Containers connect via SSE over
host.docker.internal:9902
- nano-brain runs separately on host (port 3100)
- playwright stays container-local (needs container Chromium)
- Memory savings: ~3.4GB → ~330MB for typical setup (3 containers × 2 CLIs × 4 MCPs)
Quick Start
One command does everything (install + generate configs + start proxy):
npx @nano-step/shared-mcp-proxy
Or use individual commands:
npx @nano-step/shared-mcp-proxy install
npx @nano-step/shared-mcp-proxy generate
npx @nano-step/shared-mcp-proxy start
npx @nano-step/shared-mcp-proxy stop
npx @nano-step/shared-mcp-proxy status
npx @nano-step/shared-mcp-proxy restart
Server Management
npx @nano-step/shared-mcp-proxy list
npx @nano-step/shared-mcp-proxy enable <name>
npx @nano-step/shared-mcp-proxy disable <name>
Logging
Debug logging is off by default. Enable it to see all MCP requests flowing through the proxy.
npx @nano-step/shared-mcp-proxy logs --enable
npx @nano-step/shared-mcp-proxy restart
npx @nano-step/shared-mcp-proxy logs
npx @nano-step/shared-mcp-proxy logs --status
npx @nano-step/shared-mcp-proxy logs --disable
npx @nano-step/shared-mcp-proxy logs --clear
Or run the bash scripts directly:
./install.sh && ./generate.sh && ./start.sh
MCP Servers
| Sequential-Thinking | host | Dynamic problem-solving through chain-of-thought reasoning |
| graphql-tools | host | GraphQL schema inspection and query execution |
| database-inspector | host | Database schema exploration and query tools |
| playwright | container | Browser automation (requires container Chromium) |
| nano-brain | external | Persistent memory and code intelligence (port 3100) |
| linear | host | Linear issue tracking integration |
| amplitude | host | Amplitude analytics integration |
| figma | host | Figma design file inspection |
Supported Tools
| opencode | opencode | config/opencode.mcp.json | mcp |
| amp | amp | config/amp.mcp.json | mcpServers |
| claude | claude | config/claude.mcp.json | mcpServers |
| gemini | gemini | config/gemini.mcp.json | mcpServers |
| codex | codex | config/codex.mcp.toml | mcp_servers |
| qwen | qwen | config/qwen.mcp.json | mcpServers |
| vscode | vscode | config/vscode.mcp.json | servers |
| cline | cline | config/cline.mcp.json | mcpServers |
| roocode | roocode | config/roocode.mcp.json | mcpServers |
| antigravity | antigravity | config/antigravity.mcp.json | mcpServers |
Configuration
- mcp-config.json — master config, edit this to add/remove servers or tools
- generate.sh — regenerate after editing mcp-config.json
- Each server has
"enabled": true/false to toggle without removing
- Each server has
"tools": [...] array to control which tools see it
- Environment variables for secrets: set
LINEAR_API_KEY, AMPLITUDE_API_KEY, AMPLITUDE_SECRET_KEY, FIGMA_API_KEY on host before starting mcp-proxy
Adding a New MCP Server
- Add server entry to
servers section in mcp-config.json:
"my-server": {
"command": "my-mcp-server",
"args": [],
"env": {},
"location": "host",
"tools": ["opencode", "amp", "claude"],
"enabled": true
}
- If the server needs a new npm package, add install command to
install.sh
- Run
./generate.sh to regenerate all tool configs
- Restart mcp-proxy:
./stop.sh && ./start.sh
Adding a New Tool
Custom Output Paths
Override default config paths with flags:
./generate.sh --opencode-out ~/custom/opencode.json \
--amp-out ~/custom/amp.json \
--claude-out ~/custom/claude.json \
--gemini-out ~/custom/gemini.json \
--codex-out ~/custom/codex.toml \
--qwen-out ~/custom/qwen.json \
--vscode-out ~/custom/vscode.json \
--cline-out ~/custom/cline.json \
--roocode-out ~/custom/roocode.json \
--antigravity-out ~/custom/antigravity.json