MCP-AI-Gateway
Provides integration with Ollama as a local provider for running AI models through the MCP AI Gateway, enabling routing to local Ollama instances.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-AI-GatewayExplain recursion simply"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-AI-Gateway
Unified local MCP AI Gateway that routes across Groq, OpenRouter, Mistral, and local Ollama providers, with OpenAI-compatible APIs, MCP tools, fallback/racing router, monitoring, and web dashboard.

๐ Features
Async Python gateway with provider abstraction layer
Built-in providers:
Groq (
openai/gpt-oss-120bdefault, plusmoonshotai/kimi-k2-instruct-0905)OpenRouter (
openai/gpt-4o-minidefault)Mistral (
codestral-latestdefault, plusdevstral-medium-latest)Ollama
Intelligent router:
priority routing
fallback routing
parallel racing mode
rate-limit aware provider scoring
MCP server capabilities:
tool registration/discovery
prompt template discovery/rendering
schema validation
SSE and HTTP transport
OpenAI-compatible API:
POST /v1/chat/completionsPOST /v1/completionsGET /v1/models
Web UI (React + Vite + Tailwind):
Dashboard
Providers
Models
Chat
Logs
Stats
Runtime gateway API key generation
Observability:
Prometheus metrics (
/metrics)structured logs
SQLite request statistics
Extensible plugin system for additional providers
CLI:
mcp-ai start|stop|status|providers|modelsDocker + docker-compose support
GitHub Actions CI for backend lint/tests and frontend build
๐๏ธ Repository Structure
mcp-ai-gateway/
api/
providers/
router/
mcp_server/
plugins/
database/
web_ui/
config/
cli/
tests/
Dockerfile
docker-compose.yml
README.mdโก Quick Start (Local)
1) ๐ฆ Prerequisites
Python 3.11+
Node.js 20+
Optional: local Ollama daemon at
http://localhost:11434
2) ๐ Install backend
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -e .[dev]3) ๐ Configure environment
cp .env.example .env
# edit .env values4) โ๏ธ Edit config
config/config.yaml controls providers, routing, security, and default models.
5) โถ๏ธ Start backend
uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload6) ๐ฅ๏ธ Start web UI
cd web_ui
npm install
VITE_API_BASE=http://localhost:8000 VITE_API_KEY=change-me npm run dev๐ณ Docker Deployment
docker compose up --buildServices:
Gateway API: http://localhost:8000
Web UI: http://localhost:3000
Redis:
localhost:6379(optional cache/rate-limit backend)
๐งฉ API Overview
OpenAI-Compatible ๐ค
POST /v1/chat/completionsPOST /v1/completionsGET /v1/models
Use header X-API-Key: <key> (or Authorization: Bearer <key>).
MCP Endpoints ๐
JSON-RPC MCP transport:
POST /mcpSSE streaming output:
POST /mcp/stream
Supported MCP methods:
initializenotifications/initializedpingtools/listtools/callprompts/listprompts/get
Dashboard APIs ๐
GET /api/dashboardGET /api/providersPOST /api/providers/{name}/togglePOST /api/providers/{name}/priorityPOST /api/providers/{name}/configGET /api/modelsGET /api/settingsPOST /api/settings/default-modelPOST /api/settings/api-key/generateGET /api/logsGET /api/stats
Monitoring ๐
GET /healthGET /metrics
๐ ๏ธ CLI
mcp-ai start
mcp-ai status
mcp-ai providers
mcp-ai models
mcp-ai stop๐งญ Warp MCP Integration
Add this to Warp MCP config:
{
"mcpServers": {
"mcp-ai-gateway": {
"url": "http://localhost:8000/mcp",
"headers": {
"Authorization": "Bearer REPLACE_WITH_MCP_GATEWAY_API_KEY"
}
}
}
}๐งฑ Configuration Example
providers:
groq:
enabled: true
api_key: ${GROQ_API_KEY}
priority: 1
default_model: openai/gpt-oss-120b
mistral:
enabled: false
api_key: ${MISTRAL_API_KEY}
priority: 12
default_model: codestral-latest
openrouter:
enabled: true
priority: 2
default_model: openai/gpt-4o-mini
ollama:
enabled: true
priority: 3
routing:
fallback_enabled: true
racing_mode: false๐งช Plugin Providers
New providers can be added under plugins/ by implementing ProviderPlugin and enabling provider config in config/config.yaml.
Included plugin examples:
openai_provider.pytogether_provider.pyopenrouter_provider.py
โ Testing
pytestCI runs on pushes and pull requests to main via .github/workflows/ci.yml:
Backend job:
ruff check .andpytest -qFrontend job:
npm installandnpm run buildinweb_ui/
๐ Release Workflow
Open PR from
dev/*branch tomainEnsure CI is green
Merge using GitHub CLI or GitHub UI
๐ Developer Guide
Detailed guide: docs/developer-guide.md
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/YoushaaMurhij/MCP-AI-Gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server