Skip to main content

MCP GATEWAY

MCP Gateway

An MCP gateway that gives any LLM secure access to enterprise tools through one universal protocol.

One tool call through the gatewaySimulated example
The LLM asks

Get Jira ticket PROJ-142 for the support agent.

  1. GatewayValidates the request against the MCP spec
  2. RegistryFinds the Jira tool and its Pydantic schema
  3. AuthInjects the Jira token; the model never sees it
  4. RedisWithin the rate limit; a cached copy saves a call
Structured response

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

Today
  • Connect an LLM to Salesforce: custom code
  • Connect it to Jira: different custom code
  • An internal database: yet another integration
With the MCP Gateway

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

Any MCP-compatible LLMCore GatewayFastAPI · MCP protocol · validationAuthentication layercredentials never shown to the LLMRate limiting & cachingRedisTool registrydeclarative YAML · Pydantic schemasEnterprise tools
The MCP Gateway: one gateway between any LLM and any tool

The MCP Gateway sits between any LLM and any enterprise tool. One gateway, one universal protocol, and no per-tool custom integrations.

Core Gateway

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.

Authentication Layer

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.

Rate Limiting & Caching

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.

Tool Registry

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

Why FastAPI as the gateway runtime?
FastAPIforasync-firstOpenAPI schemas

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.

Why Docker for deployment?
Dockerforcloudon-premhybrid

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.

Why Redis for rate limiting instead of in-memory?
Redisoverin-memory

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
Watch an agentBook a 20-minute call