MCP Gateway
MCP Gateway
MCP Gateway — production-ready шлюз Model Context Protocol для российских LLM: единый интерфейс к GigaChat и YandexGPT с автоматическим fallback, анонимизацией ПД по 152-ФЗ и экономией 86% на токенах.
Подключите любой MCP-клиент (Hermes Agent, Claude Code, Cursor, n8n) — и получите доступ к российским моделям через один endpoint. Стек: FastAPI, MCP SDK, GigaChat API, YandexGPT API.
✨ Возможности
Функция | Описание |
🔀 Мультипровайдерность | GigaChat (основной) + YandexGPT (fallback) + Ollama (локальный) |
🛡️ 152-ФЗ | Встроенная детекция и анонимизация ПД: телефон, ИНН, паспорт, СНИЛС, адрес |
💰 Экономия 86% | GigaChat ~200₽/M токенов против YandexGPT ~1 455₽/M токенов |
🔄 Авто-fallback | Бесшовное переключение провайдеров при ошибках и rate-limit (429) |
🐳 Docker Ready | Полный Docker Compose для развёртывания одной командой |
💚 Health Checks | Эндпоинты мониторинга и systemd-сервис с автозапуском |
Related MCP server: MCP LLM Generator v2
🏗️ Архитектура
flowchart TB
classDef client fill:#eef2f7,stroke:#4a5568,stroke-width:1.5px
classDef gateway fill:#edf2f7,stroke:#4a5568,stroke-width:1.5px
classDef llm fill:#e2e8f0,stroke:#4a5568,stroke-width:1.5px
subgraph Client["👤 Клиент"]
Agent["🤖 MCP-клиент<br>Hermes Agent / Claude Code / n8n"]
end
class Client client
subgraph Gateway["⚙️ MCP Gateway (FastAPI, port 8000)"]
MCP["MCP Server<br>5 tools"]
Anon["🛡️ Анонимизатор ПД<br>152-ФЗ"]
Fallback["🔀 Fallback-оркестратор"]
MCP --> Anon --> Fallback
end
class Gateway gateway
subgraph Providers["🧠 LLM-провайдеры"]
Giga["GigaChat<br>~200₽/M токенов"]
Yandex["YandexGPT<br>~1 455₽/M токенов"]
Ollama["Ollama<br>локально, 0₽"]
end
class Providers llm
Agent --> MCP
Fallback -->|"основной"| Giga
Fallback -.->|"fallback"| Yandex
Fallback -.->|"fallback"| Ollama🚀 Быстрый старт
# Клонирование
git clone https://github.com/kvochkin-dev/mcp-gateway.git
cd mcp-gateway
# Настройка окружения
cp .env.example .env
# Впишите свои API-ключи в .env
# Запуск через Docker
docker-compose up -d
# Или напрямую
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python app.py📋 API Endpoints
Метод | Путь | Описание |
|
| Статус сервиса и провайдеров |
|
| Swagger UI |
|
| MCP-интерфейс (tools) |
Health Check
curl http://localhost:8000/health{
"status": "healthy",
"gigachat": "connected",
"yandexgpt": "connected",
"anonymizer": "ready"
}🔐 Конфигурация
Все секреты хранятся в .env (файл исключён из git):
GIGACHAT_CLIENT_ID=***
GIGACHAT_CLIENT_SECRET=***
YANDEXGPT_API_KEY=***
YANDEXGPT_FOLDER_ID=***🧪 Тесты
pytest tests/ -v13/13 тестов passed — клиенты провайдеров, fallback-логика, анонимизатор ПД.
📁 Структура проекта
mcp-gateway/
├── app.py # FastAPI + MCP сервер
├── src/
│ ├── clients/ # GigaChat, YandexGPT клиенты
│ └── anonymizer/ # 152-ФЗ анонимизация ПД
├── scripts/
│ └── mcp-monitor.sh # Мониторинг сервисов
├── docs/ # Отчёты и документация
├── tests/ # 13 тестов
└── docker-compose.yml # Docker-развёртывание📄 Лицензия
MIT — используйте свободно.
This server cannot be installed
Maintenance
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
- FlicenseNot gradedqualityDmaintenanceProvides a unified MCP interface for running completions, embeddings, image generation, and classification across OpenAI, Anthropic, Groq, and Mistral. Eliminates provider-specific boilerplate by standardizing API calls for text generation, vector embeddings, and classification tasks.
- AlicenseNot gradedqualityDmaintenanceProduction-ready MCP server enabling LLM text generation, template management, context-aware conversations, and memory storage with enterprise quality assurance.112MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for interacting with Yandex Cloud AI Studio, enabling chat, text generation, image generation, speech recognition/synthesis, embeddings, classification, search indexes, and AI agent creation with function calling.
- FlicenseNot gradedqualityDmaintenanceCentralized gateway for multiple AWS Bedrock models through the Model Context Protocol (MCP), enabling AI agents to interact with 15+ Bedrock models like Nova, Claude, Llama, and Mistral.1
Related MCP Connectors
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP server for AI dialogue using various LLM models via AceDataCloud
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/kvochkin-dev/mcp-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server