Skip to main content
Back to Work
CASE STUDY

Nexus

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

MCP FastAPI Docker PostgreSQL Redis Pydantic
  • 4 weeks
  • Solo Architect & Builder
  • Production

The Problem

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

Nexus is an MCP gateway that sits between any LLM and any enterprise tool. One gateway. Universal protocol. Zero per-tool custom integrations.

Core Gateway

FastAPI-based server that implements the MCP specification. 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. Nexus manages credentials securely, injecting them at request time without exposing them to the LLM. Credentials are stored encrypted in PostgreSQL with automatic rotation support.

Rate Limiting & Caching

Redis-backed rate limiting prevents any single LLM session from overwhelming backend services. Intelligent caching of tool responses reduces 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. Define the tool's name, description, input schema (Pydantic models), authentication method, and backend endpoint. Nexus generates the MCP-compatible tool definition automatically. Adding a new enterprise tool takes minutes, not days.


Technical Decisions

Why FastAPI as the gateway runtime?
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?
Nexus 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?
Horizontal scalability. When Nexus runs behind a load balancer with multiple gateway instances, rate limits must be shared across all instances. Redis provides the distributed state layer.

Results

6
Tool Integrations
<200ms
Median Latency
<15min
Tool Onboarding
1,000+
Concurrent Sessions