Skip to main content
Feedback

Connecting STDIO MCP servers to MCP Gateway

When you connect your existing public MCP servers to MCP Gateway, it takes care of running and managing them for you. You can connect your MCP Servers using the MCP Gateway control plane or by manually creating and configuring your mcp.json.

Step 1: Configuring mcp.json

Create or update your mcp.json configuration file:

cd config
nano mcp.json

For example:

{
"mcpServers": {
"memory": {
"args": [
"-y",
"@modelcontextprotocol/server-memory"
],
"command": "npx",
"env": {
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
},
"icon": "📝"
},
"time": {
"args": [
"mcp-server-time",
"--local-timezone=America/New_York"
],
"command": "uvx",
"env": {},
"icon": "⏰"
}
}
}

Refer to the mcp.json configuration guide for detailed information.

Step 2: Setting environment variables

Define the required environment variables for your MCP servers in your Docker container.

# Google Maps
export GOOGLE_MAPS_API_KEY="your-google-maps-api-key"

# Slack
export SLACK_BOT_TOKEN="your-slack-bot-token"
export SLACK_CHANNEL_IDS="channel1,channel2"
export SLACK_TEAM_ID="your-team-id"
On this Page