Skip to main content
Glama
fabienfrfr

MCP Gateway

by fabienfrfr

MCP Gateway

A generic, semantic MCP gateway exposing any HTTP-based SQL portal as both LLM-friendly MCP tools and standard REST endpoints. Designed from the ground up to serve human users (via UI/API) and AI agents simultaneously.

uv run main.py
uv run chainlit run chatbot.py -w

Architecture

                  +------------------+
                  |    Human User    |
                  +--------+---------+
                           |
                           | HTTP / REST
                           v
+---------+  MCP  +------------------+  HTTP  +------------------+
|   AI    +------>|   FastAPI App    +------>| SQL HTTP Portal  |
| (Agent) |       | (Semantic Layer) | (SQL) |                  |
+---------+       +--------+---------+       +------------------+
    ^                      |
    |                      |
    +--- from_fastapi() ---+
    (FastMCP Auto-maps tools)
User / Agent
     |
HTTP | MCP
     |
     v
+-------------+
| MCP Gateway |
+-------------+
       |
       +--> Auth : OIDC | OAuth2 | API Key
       +--> Secrets : .env | Secret Store | KMS
       +--> Identity : User Token | Service Account
       |
 HTTPS + Bearer Token
       |
       +--> OTCS
       +--> SQL Portal
       +--> REST API
       +--> CMIS API
       +--> Any Backend

Related MCP server: anythingmcp

Core Design Principles (LLM & Human Best Practices)

  1. Semantic Layer Abstraction: No raw CRUD endpoints. Expose high-level intent routes (/search-tables, /top, /explore) to reduce LLM cognitive load and simplify frontend code.

  2. Strict Explict Identification: Every route enforces a clean, action-oriented operation_id (query_sql, search_tables). FastMCP maps these directly into clear tool names for the LLM.

  3. Intent-Driven Documentation: Docstrings explicitly declare when and why to use the endpoint ("""Semantic table search."""), acting directly as LLM prompt steering.

  4. Strict Typing via Enums: Restrict input options using Pydantic Enums to eliminate LLM parameter hallucinations.

  5. Server-Side Data Aggregation: Compute metrics and perform table joins inside Python to save LLM context window tokens and prevent API call chaining.


Pros & Cons

Advantages

  • DRY Codebase: Single source of truth. One FastAPI setup automatically serves both humans (REST) and AI (MCP).

  • AI-First Performance: Fastembed vector search and server-side constraints (FORBIDDEN keywords, limits) keep the LLM fast, secure, and accurate.

  • Low Footprint: No heavy local database or native drivers required; works over standard HTTP.

Disadvantages

  • Path Parameter Blindness: Complex dynamic routes like /distinct/{table}/{column} require the LLM to successfully call /search-tables first to discover valid values.

  • Tight Coupling: Aligning REST routes to serve both human UX and LLM token-efficiency can require design trade-offs for heavily nested data.

AI

# if : full python agent (use openrouter)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install aider-chat --python 3.12 --force
uv tool install specify-cli
specify init mcp-gateway --integration claude --ignore-agent-tools
aider --model openrouter/nvidia/nemotron-3-ultra-550b-a55b:free --no-auto-commits --test-cmd pytest

# else :
sudo bash script.sh 
F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    A universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
    14
  • A
    license
    A
    quality
    A
    maintenance
    Self-hosted source-available MCP gateway that turns REST, SOAP/WSDL, GraphQL, and SQL/NoSQL databases into MCP tools. Imports OpenAPI/Postman/WSDL/GraphQL specs and bridges multiple MCP servers behind one endpoint. Ships with 29 pre-built adapters and built-in OAuth2 + RBAC + audit log.
    4
    177
    AGPL 3.0
  • F
    license
    Not graded
    quality
    B
    maintenance
    A self-hosted MCP gateway that turns REST, SOAP, GraphQL, and SQL endpoints into MCP tools, enabling AI clients like Claude and ChatGPT to interact with legacy and modern APIs without code changes.
  • A
    license
    Not graded
    quality
    C
    maintenance
    Acts as a bridge between standard REST/OpenAPI web APIs and the Model Context Protocol, dynamically converting REST endpoints into MCP tools for LLM clients like Cursor, Claude Desktop, and n8n.
    24
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fabienfrfr/mcp-gateway'

If you have feedback or need assistance with the MCP directory API, please join our Discord server