MCP Gateway Implementations for Connecting to Databases and APIs

MCP gateway implementations are translation layers that expose databases and REST APIs as native Model Context Protocol tools, enabling LLMs to query PostgreSQL, MongoDB, OpenAPI services, and more through standardized JSON-RPC interfaces.

The punkpeye/awesome-mcp-servers repository curates production-ready MCP gateway implementations that bridge the gap between LLM agents and external data sources. These gateways handle schema discovery, authentication, and protocol translation, allowing Claude, Cursor, and other MCP clients to interact with SQL databases and HTTP APIs using natural language tool calls.

Database-Focused MCP Gateways

HelpCode-ai/anythingmcp: The Universal Database Bridge

HelpCode-ai/anythingmcp is a self-hosted, source-available gateway written in Python that functions as a stdlib-compatible MCP server. It parses OpenAPI, Postman, WSDL, and GraphQL specifications at startup to generate a mcp_manifest.json tool manifest.

The implementation supports SQL and NoSQL databases including PostgreSQL, MySQL, MariaDB, MSSQL, Oracle, MongoDB, and SQLite. Each table or collection maps to distinct MCP tools (e.g., list_users, get_order). The gateway provides per-user MCP API keys and RBAC to restrict which endpoints a model may call, supporting authentication methods like OAuth2 PKCE, API keys, Bearer tokens, and WS-Security.

This gateway is ideal when you need a single, no-code solution to ingest disparate backends—such as internal ERP systems and external SaaS APIs—and expose them as a unified toolset.

To deploy anythingmcp with a PostgreSQL database and OpenAPI spec:

pip install anythingmcp

anythingmcp \
  --openapi https://api.example.com/openapi.json \
  --db-postgres "postgresql://user:pass@localhost:5432/mydb" \
  --port 8000

Then query from an MCP client:

from mcp import Client

client = Client("http://localhost:8000")
customers = client.call("list_customers", {})
print(customers)

centralmind/gateway: Schema-Driven Database APIs

centralmind/gateway is a Go-based server that auto-generates MCP tools by introspecting database schemas. It connects to PostgreSQL, ClickHouse, MySQL, Snowflake, BigQuery, and Supabase, generating a GraphQL-style MCP API where each table becomes a tool (list_customers, insert_order).

The implementation supports Server-Sent Events (SSE) for streaming large result sets, making it suitable for data-heavy workloads where you need instant, schema-driven access without writing boilerplate adapters.

Deploy via Docker:

docker run -p 8080:8080 \
  -e DB_URL="postgresql://admin:pwd@db:5432/analytics" \
  centralmind/gateway

Query the orders table:

curl -X POST http://localhost:8080 \
  -d '{"jsonrpc":"2.0","id":1,"method":"list","params":{"resource":"orders"}}'

API Integration Gateways

MikkoParkkola/mcp-gateway: Meta-MCP and Multiplexing

MikkoParkkola/mcp-gateway is a Go-based universal gateway featuring single-port multiplexing and the Meta-MCP pattern. Instead of registering hundreds of individual tools, it exposes four meta-tools (list, get, call, schema) that route to concrete endpoints, drastically reducing token usage.

The gateway auto-imports OpenAPI definitions and generates approximately 25 zero-config tools at startup. It supports hot-reloadable capabilities, allowing you to add new OpenAPI files at runtime without restarting.

Install and run:

go install github.com/MikkoParkkola/mcp-gateway@latest

mcp-gateway \
  --openapi ./specs/payment-api.yaml \
  --reload \
  --listen :9000

Sample JSON-RPC call:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "list_transactions",
  "params": { "start_date": "2024-01-01", "end_date": "2024-01-31" }
}

mroops0111/openapi-mcp-gateway: Multi-Spec Aggregation

mroops0111/openapi-mcp-gateway is a Python server that loads multiple OpenAPI JSON/YAML files (or FastAPI apps) into a single MCP process. It promotes eligible GET endpoints to MCP resources automatically while exposing other verbs via a generic call tool.

The implementation includes per-user OAuth2 token relay that scopes calls to the original API audience, making it useful when you have a suite of internal services with existing OpenAPI documentation and want to expose them to agents with zero additional code.

ViperJuice/mcp-gateway: Progressive Disclosure

ViperJuice/mcp-gateway is a Node.js/TypeScript meta-server that implements progressive disclosure. It lazily loads tool adapters only when a model requests them, offering nine stable meta-tools (discover, invoke, load) that dynamically provision external MCP servers on-demand.

This approach keeps the context window lean by instantiating only the tools actually used by the model, such as Playwright/Chrome sessions or Context7 browsing capabilities.

Cross-Cutting Infrastructure

tsouth89/toolport: The Local MCP Broker

tsouth89/toolport is a Rust-based MCP broker that runs as a local daemon and shares a single credential store (OS keychain). It performs lazy discovery, fetching tools from originating servers only when first referenced, and handles authentication once, injecting tokens into downstream servers automatically.

Install and configure:

cargo install toolport
toolport serve --port 7070

toolport register --name anythingmcp --url http://localhost:8000

Call tools through the unified endpoint:

curl -X POST http://localhost:7070 \
  -d '{"jsonrpc":"2.0","id":1,"method":"list_customers","params":{}}'

This is ideal for workstation setups where multiple agents (Claude Desktop, Cursor, VS Code) need a common credential vault without re-authenticating each time.

How MCP Gateways Work Internally

Discovery and Manifest Generation

At startup, gateways scan target data sources—database schemas, OpenAPI specs, or WSDL files—and produce a tool manifest (mcp_manifest.json). This manifest describes each tool's name, input schema (JSON-Schema), and output schema, as documented in the "Server Implementations → Aggregators" section (lines 31-38) of the README.md in punkpeye/awesome-mcp-servers.

Authentication and Security

Gateways abstract credential handling by storing OAuth2 PKCE flows, API keys, and TLS client certificates securely—often in the OS keychain—and injecting them into outgoing HTTP calls or database connections. The "Server Implementations → Cloud Platforms" section (around line 84) highlights cloud-oriented gateways specializing in SaaS authentication patterns.

Request Translation

When a model invokes tool_name(arguments), the gateway translates the JSON-RPC-style MCP call into native protocols—SQL queries, HTTP requests, or gRPC calls—and serializes responses back into MCP-compatible JSON.

Meta-MCP and Tool Consolidation

Advanced implementations like MikkoParkkola and ViperJuice use Meta-MCP patterns, exposing a few generic meta-tools that internally route to many concrete endpoints. This reduces the number of tool definitions embedded in the model's context, saving token budget and improving latency.

Streaming with Server-Sent Events

For large result sets (e.g., millions of rows), gateways like centralmind/gateway use Server-Sent Events (SSE) to stream partial results. This allows the model to process data incrementally without waiting for the entire payload, as noted in the "Server Implementations → Databases" section (around line 92) of the repository.

Summary

  • MCP gateways translate between Model Context Protocol and external data sources, exposing databases and APIs as callable tools.
  • HelpCode-ai/anythingmcp provides comprehensive database support with RBAC, while centralmind/gateway offers schema introspection and SSE streaming for SQL warehouses.
  • MikkoParkkola/mcp-gateway reduces token usage through Meta-MCP patterns and hot-reloadable OpenAPI imports.
  • mroops0111/openapi-mcp-gateway aggregates multiple API specifications into a single process with OAuth2 relay.
  • tsouth89/toolport acts as a local credential broker, enabling multiple MCP clients to share authentication state.
  • All implementations generate mcp_manifest.json files describing available tools and support secure credential injection via OAuth2, API keys, or TLS certificates.

Frequently Asked Questions

What is the difference between an MCP gateway and a standard MCP server?

An MCP gateway acts as a translation bridge between the Model Context Protocol and external systems like PostgreSQL or REST APIs, often supporting multiple backends simultaneously. A standard MCP server typically implements a specific toolset directly. Gateways like anythingmcp and mcp-gateway dynamically generate tool definitions from OpenAPI specs or database schemas, whereas standard servers require manual tool implementation.

Which MCP gateway implementation is best for high-throughput database queries?

centralmind/gateway is optimized for data-heavy workloads, supporting Server-Sent Events (SSE) for streaming large result sets from PostgreSQL, ClickHouse, Snowflake, and BigQuery. Its Go-based architecture and direct schema introspection make it suitable for analytics workloads requiring millions of rows, while HelpCode-ai/anythingmcp offers broader database compatibility (including Oracle and MongoDB) with built-in RBAC for multi-tenant scenarios.

How do MCP gateways handle authentication with external APIs?

Gateways abstract authentication through OAuth2 PKCE flows, API key injection, Bearer token relay, and WS-Security. For example, mroops0111/openapi-mcp-gateway implements per-user OAuth2 token relay that scopes calls to the original API audience, while tsouth89/toolport stores credentials in the OS keychain and automatically injects them into downstream requests. This allows models to call authenticated endpoints without exposing secrets in the context window.

Can I use multiple MCP gateways simultaneously with the same client?

Yes, using a broker like tsouth89/toolport, you can register multiple downstream gateways (e.g., one for databases, one for REST APIs) under a single local endpoint. The broker performs lazy discovery, fetching tools from each registered gateway only when first referenced, and maintains a unified credential store. This allows Claude Desktop, Cursor, and VS Code to access diverse backends through one local port without configuration conflicts.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →