MCP GATEWAY
MCP Gateway
An MCP gateway that gives any LLM secure access to enterprise tools through one universal protocol.
Get Jira ticket PROJ-142 for the support agent.
- GatewayValidates the request against the MCP spec
- RegistryFinds the Jira tool and its Pydantic schema
- AuthInjects the Jira token; the model never sees it
- RedisWithin the rate limit; a cached copy saves a call
PROJ-142 returned to the model as structured data, and the call is logged.
The MCP Gateway gives any language model safe access to company tools through one gateway. Credentials stay out of the model, every call is rate limited and logged, and a new tool takes minutes to add.
- Scope
- 1 gateway, any tool
- Role
- Solo Architect & Builder
- Status
- FastAPI + Redis
- Stack
- MCP
- FastAPI
- Docker
- PostgreSQL
- Redis
- Pydantic
The Problem
- Connect an LLM to Salesforce: custom code
- Connect it to Jira: different custom code
- An internal database: yet another integration
One gateway, one universal protocol, no per-tool custom integrations
Every AI tool integration is a custom job. Connect an LLM to Salesforce — custom code. Connect it to Jira — different custom code. Connect it to an internal database — yet another integration. Multiply this by every model, every tool, every team, and you get an integration matrix that grows quadratically.
The Model Context Protocol (MCP) solves this by standardizing how LLMs connect to external tools. But MCP alone is a protocol — someone still needs to build the gateway, handle authentication, manage rate limiting, and ensure enterprise-grade security.
The Architecture
The MCP Gateway sits between any LLM and any enterprise tool. One gateway, one universal protocol, and no per-tool custom integrations.
A FastAPI-based server that implements the MCP specification. It receives tool requests from any MCP-compatible client, routes them to the appropriate backend service, and returns structured responses. The gateway handles protocol negotiation, request validation, and response formatting.
Enterprise tools require authentication — API keys, OAuth tokens, service accounts. The MCP Gateway manages credentials securely and injects them at request time without exposing them to the LLM. Credentials are stored encrypted in PostgreSQL with rotation support.
Redis-backed rate limiting stops any single LLM session from overwhelming backend services. Caching tool responses cuts redundant API calls — when 10 agents ask for the same Jira ticket in 30 seconds, only one request hits the Jira API.
New tools are registered through a declarative YAML configuration. You define the tool's name, description, input schema (Pydantic models), authentication method, and backend endpoint. The MCP Gateway generates the MCP-compatible tool definition automatically, so adding a new enterprise tool takes minutes, not days.
Technical Decisions
Async-first with automatic OpenAPI schema generation. MCP tool definitions map directly to FastAPI's Pydantic-based request/response models. The framework's dependency injection system cleanly handles per-request authentication context.
The MCP Gateway needs to run in diverse enterprise environments — cloud, on-prem, hybrid. Docker provides the consistent runtime environment. Each tool backend can run as a sidecar container with its own dependency isolation.
Horizontal scalability. When the MCP Gateway runs behind a load balancer with multiple gateway instances, rate limits must be shared across all instances. Redis provides the distributed state layer.
What the MCP Gateway Measures
The MCP Gateway tracks four measures on every deployment. This page reports a number only when it comes from a real run or a real client:
- Median gateway latency per tool call
- Time to add a new tool, from YAML file to first successful call
- Concurrent sessions held without errors
- Calls stopped by rate limits and served from cache