multi-cloud-llm-platform
Exposes multiple LLM providers (AWS Bedrock, OpenAI, Google Gemini, local Ollama) as MCP tools with automatic routing by task type and Prometheus metrics, enabling any MCP-compatible client to generate text, route prompts, and list providers.
README
Multi-Cloud LLM Platform
A provider-agnostic LLM routing layer spanning AWS Bedrock, OpenAI, and local Ollama models, instrumented with Prometheus metrics, wrapped in a LangGraph iterative research agent, and exposed to any MCP-compatible client (e.g. Claude Desktop) as callable tools over an MCP stdio server.
Overview
┌─────────────── src/providers.py ───────────────┐
│ claude-sonnet-bedrock (AWS Bedrock) │
prompt ──────▶│ llama3-bedrock (AWS Bedrock) │──▶ LLMResponse
or │ gemini-flash-vertex (low-cost tier) │ (+ Prometheus metrics:
route(task) ─▶│ llama3-local (Ollama, local/free) │ requests, latency, cost, tokens)
└──────────────────────────────────────────────────┘
▲ ▲
│ │
agents/research_agent.py mcp_server/server.py
(LangGraph loop: gather (exposes generate/route/
→ evaluate → write report) list_providers as MCP tools)
route(prompt, task_type) picks a provider based on task type (code/reason → Claude Sonnet on Bedrock, summarize → Llama 3 on Bedrock, low-cost → the low-cost tier, general → local Ollama), so callers don't need to know which backend is cheapest or best suited for a given job.
Project structure
.
├── src/
│ ├── providers.py # Provider catalog + generate()/route(), Prometheus instrumentation
│ └── metrics.py # Prometheus Counter/Histogram definitions
├── agents/
│ └── research_agent.py # LangGraph agent: iteratively researches a topic, then writes a report
├── mcp_server/
│ └── server.py # MCP stdio server exposing generate/route/list_providers as tools
├── tests/
│ └── test_platform.py # Provider registration, routing table, and research-agent tests
├── run_mcp.sh # Convenience launcher for the MCP server
└── requirements.txt
Providers
| Key | Backend | Cost / 1K tokens | Strengths |
|---|---|---|---|
claude-sonnet-bedrock |
Claude 3.5 Sonnet via AWS Bedrock | $0.003 | reasoning, writing, code |
llama3-bedrock |
Llama 3 8B Instruct via AWS Bedrock | $0.0003 | summarization, classification |
gemini-flash-vertex |
Gemini 1.5 Flash | $0.0005 | low-cost, fast, general |
llama3-local |
Llama 3 via local Ollama | $0.0 | privacy, offline, no-cost |
Every call increments Prometheus counters/histograms for request count, latency, estimated cost, and token usage, labeled by provider.
Research agent
agents/research_agent.py builds a small LangGraph loop:
- gather_information — asks the model (local Llama 3 by default) for 3–5 new facts on the topic not already covered.
- evaluate_sufficiency — asks the model whether enough has been gathered for a 3-paragraph report.
- Loops back to step 1 (up to 3 iterations) or proceeds to write_report, which synthesizes all notes into the final report.
MCP server
mcp_server/server.py runs an MCP stdio server (multi-cloud-llm-platform) that advertises three tools — generate, route, and list_providers — so any MCP client can call these LLM providers directly. Launch it with:
python -m mcp_server.server
Setup
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
- AWS Bedrock (
claude-sonnet-bedrock,llama3-bedrock): configure AWS credentials (~/.aws/credentials, env vars, or an IAM role) with Bedrock model access enabled inus-east-1for the Claude 3.5 Sonnet and Llama 3 models. - Low-cost tier (
gemini-flash-vertex): requiresexport GOOGLE_API_KEY=<your-google-ai-studio-key>. - Local (
llama3-local): install Ollama and runollama pull llama3.
Usage
# Run a single generation or routed call
python -c "from src.providers import route; print(route('Summarize this quarter', task_type='summarize').text)"
# Run the iterative research agent
python -m agents.research_agent
# Run the MCP server
./run_mcp.sh # or: python -m mcp_server.server
# Run tests
pytest
Tech stack
LangChain, LangGraph, AWS Bedrock (boto3), Google Gemini, Ollama, MCP (mcp), Prometheus client, FastAPI/uvicorn, pytest.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。