OM

oliverye7/mcp-gateway

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

12 stars 5 forks Качество 50 Тренд 8MIT

A routing proxy for agent traffic to Model Context Protocol (MCP) servers. This gateway enables seamless integration between AI agents and MCP servers, providing intelligent request routing, session...

Обзор

A routing proxy for agent traffic to Model Context Protocol (MCP) servers. This gateway enables seamless integration between AI agents and MCP servers, providing intelligent request routing, session management, and usage analytics. There are some very interesting downstream applications of a more involved version of this but I wanted to just release a very lightweight and extendable version :) : Single Python file deployment with minimal dependencies : Easy to extend, modify, and customize for your specific needs : Full control over your infrastructure and data - : Routes requests to appropriate MCP servers using OpenAI-powered tool matching - : Persistent session handling for stateful interactions - : Queue-based request processing with Redis backend - : RESTful interface for easy integration with any agent runtime - : Built-in metrics and monitoring capabilities - : Easy to add new MCP servers and custom routing logic The MCP Gateway uses a simple, modular architecture designed...

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Gateway

A lightweight, modular, and self-hostable routing proxy for agent traffic to Model Context Protocol (MCP) servers. This gateway enables seamless integration between AI agents and MCP servers, providing intelligent request routing, session management, and usage analytics. There are some very interesting downstream applications of a more involved version of this but I wanted to just release a very lightweight and extendable version :)

Self-Host Ready: Single Python file deployment with minimal dependencies
Highly Modular: Easy to extend, modify, and customize for your specific needs
Zero Lock-in: Full control over your infrastructure and data

Features

  • Intelligent Routing: Routes requests to appropriate MCP servers using OpenAI-powered tool matching
  • Session Management: Persistent session handling for stateful interactions
  • Redis Integration: Queue-based request processing with Redis backend
  • HTTP API: RESTful interface for easy integration with any agent runtime
  • Usage Analytics: Built-in metrics and monitoring capabilities
  • Extensible: Easy to add new MCP servers and custom routing logic

Architecture

The MCP Gateway uses a simple, modular architecture designed for easy self-hosting and customization:

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   AI Agents     │    │  MCP Gateway    │    │   Any Tool      │
│                 │    │                 │    │                 │
│ • Claude Code   │◄──►│ • Smart Routing │◄──►│ • MCP           │
│ • Custom Agents │    │ • Session Mgmt  │    │ • Other Agents  │
│ • LLM Apps      │    │ • HTTP/MCP APIs │    │ • (any endpoint)│
│                 │    │                 │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘

Two Integration Paths

  1. HTTP API Mode: Direct REST API calls to the gateway

    • Perfect for web apps, microservices, and custom integrations
    • Simple HTTP POST/GET requests
    • Session management via headers
  2. MCP Server Mode: Gateway acts as an MCP server itself

    • Use mcp_remote.py to expose gateway as an MCP server
    • Native MCP protocol support
    • Seamless integration with MCP-compatible agents

Core Components

  • gateway.py: Main routing engine with intelligent tool matching (currently supports all MCPs, can be extended to generic tools)
  • session.py: Stateful session management for multi-turn conversations
  • mcp_remote.py: MCP server wrapper for native protocol support
  • mcp_servers/: Example server implementations you can extend
  • servers.txt: List of any MCPs you want to support

🚀 Quick Start (30 seconds)

Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →