A flexible gateway server that bridges Model Context Protocol (MCP) STDIO servers to MCP HTTP+SSE and REST API, enabling multi-instance MCP servers to be exposed over HTTP.
- Run multiple instances of the same MCP server type
- Configure multiple different MCP server types
- Flexible network binding configuration
- Clean separation between server instances using session IDs
- Automatic cleanup of server resources on connection close
- YAML-based configuration
- Optional Basic and Bearer token authentication
- Configurable debug logging levels
- REST API Support
MCP Gateway now provides a REST API interface to MCP servers, making them accessible to any HTTP client that supports OpenAPI/Swagger specifications. This feature is particularly useful for integrating with OpenAI's custom GPTs and other REST API clients.
Before making tool calls, you need to get a session ID:
curl "http://localhost:3000/api/sessionid"
# Returns: {"sessionId": "<generated-id>"}Each tool exposed by an MCP server is available at:
POST /api/{serverName}/{toolName}?sessionId={session-id}
Note: The sessionId query parameter is required for all tool calls.
For example, to call the directory_tree tool on a filesystem MCP server:
# First get a session ID
SESSION_ID=$(curl -s "http://localhost:3000/api/sessionid" | jq -r .sessionId)
# Then make the tool call
curl -X POST "http://localhost:3000/api/filesystem/directory_tree?sessionId=$SESSION_ID" \
-H "Content-Type: application/json" \
-d '{"path": "/some/path"}'The gateway can generate OpenAPI schemas for all configured tools, making it easy to integrate with OpenAPI-compatible clients: