
一个模型-不可知信件控制协议(MCP)服务器,它能够与各种大语言模型(LLMs)如GPT,DeepSeek,Claude等进行无缝整合.
概览
LLM Bridge MCP允许AI代理通过标准化接口与多大语言模型进行交互. 它利用信件控制协议(MCP)为不同的LLM提供者提供无缝访问,使得在模型之间切换或在同一应用中使用多模型变得容易. - 多个LLM提供者的统一接口: - OpenAI(GPT模型) - Anthropic(Claude模型) - Google(Gemini模型) - DeepSeek - ... - 与 Pydantic AI相建用于类型安全和验证 - 支持温度和最大值等自定义参数 - 提供使用跟踪和度量衡 服务器执行以下工具: - 提示 : 发送到 LLM 的文本提示 - model name: 需要使用的特定模式(默认为"openai:gpt-4o-mini") - 温度: 控制随机性(0.0至1).
概述(AI 翻译)
LLM Bridge MCP允许AI代理通过标准化接口与多大语言模型进行交互. 它利用信件控制协议(MCP)为不同的LLM提供者提供无缝访问,使得在模型之间切换或在同一应用中使用多模型变得容易.
□ 特性
- 多个LLM提供者的统一接口:
- OpenAI(GPT型号)
- Athropic(克洛德模型)
- 谷歌(Gemini模型)
- 深层搜索
-
- 由Pydantic AI建造,用于类型安全和验证
- 支持温度和最大值等可定制参数
- 提供使用情况跟踪和衡量标准
□ 工具
服务器执行以下工具:
- [[T0]: 发送到 LLM 的文本提示
model_name:要使用的具体模型(默认:“openai:gpt-4o-mini”)- [[T2]:控制随机性(0.0至1.0)
- [[T3]: 要生成的最大符数
- [[T4]: 可选系统提示以引导模型的行为
□ 安装
通过 Smithery 安装
要通过 Smithery 自动为 Claude 桌面安装 llm-bridge- mcp :
手动安装
-
清除储存库:
-
安装uv(如果尚未安装):
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
LLM Bridge MCP
LLM Bridge MCP allows AI agents to interact with multiple large language models through a standardized interface. It leverages the Message Control Protocol (MCP) to provide seamless access to different LLM providers, making it easy to switch between models or use multiple models in the same application.
Features
- Unified interface to multiple LLM providers:
- OpenAI (GPT models)
- Anthropic (Claude models)
- Google (Gemini models)
- DeepSeek
- …
- Built with Pydantic AI for type safety and validation
- Supports customizable parameters like temperature and max tokens
- Provides usage tracking and metrics
Tools
The server implements the following tool:
run_llm(
prompt: str,
model_name: KnownModelName = "openai:gpt-4o-mini",
temperature: float = 0.7,
max_tokens: int = 8192,
system_prompt: str = "",
) -> LLMResponse
prompt: The text prompt to send to the LLMmodel_name: Specific model to use (default: “openai:gpt-4o-mini”)temperature: Controls randomness (0.0 to 1.0)max_tokens: Maximum number of tokens to generatesystem_prompt: Optional system prompt to guide the model’s behavior
Installation
Installing via Smithery
To install llm-bridge-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @sjquant/llm-bridge-mcp --client claude
Manual Installation
- Clone the repository:
git clone https://github.com/yourusername/llm-bridge-mcp.git
cd llm-bridge-mcp
- Install uv (if not already installed):
# On macOS
brew install uv
# On Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Configuration
Create a .env file in the root directory with your API keys:
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GOOGLE_API_KEY=your_google_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
Usage
Using with Claude Desktop or Cursor
Add a server entry to your Claude Desktop configuration file or .cursor/mcp.json:
"mcpServers": {
"llm-bridge": {
"command": "uvx",
"args": [
"llm-bridge-mcp"
],
"env": {
"OPENAI_API_KEY": "your_openai_api_key",
"ANTHROPIC_API_KEY": "your_anthropic_api_key",
"GOOGLE_API_KEY": "your_google_api_key",
"DEEPSEEK_API_KEY": "your_deepseek_api_key"
}
}
}
Troubleshooting
Common Issues
1. “spawn uvx ENOENT” Error
安装
uvx llm-bridge-mcp配置
"mcpServers": {
"llm-bridge": {
"command": "uvx",
"args": [
"llm-bridge-mcp"
],
"env": {
"OPENAI_API_KEY": "your_openai_api_key",
"ANTHROPIC_API_KEY": "your_anthropic_api_key",
"GOOGLE_API_KEY": "your_google_api_key",
"DEEPSEEK_API_KEY": "your_deepseek_api_key"
}
}
}