Skip to main content
Glama
Cross-LLM MCP Server

Cross-LLM MCP Server

by JamesANZ

🤖 Cross-LLM MCP 服务器

从一个地方访问多个 LLM API。 调用 ChatGPT、Claude、DeepSeek、Gemini、Grok、Kimi、Perplexity、Mistral 和 Hugging Face 推理路由器,并具备智能模型选择、偏好设置和提示词日志记录功能。

这是一个 MCP (模型上下文协议) 服务器,为 Cursor 和 Claude Desktop 等 AI 编码环境提供对多个大语言模型 API 的统一访问。

信任评分

为什么使用 Cross-LLM MCP?

  • 🌐 9 个 LLM 提供商 – ChatGPT、Claude、DeepSeek、Gemini、Grok、Kimi、Perplexity、Mistral、Hugging Face

  • 🎯 智能模型选择 – 基于标签的偏好设置(编码、商业、推理、数学、创意、通用)

  • 📊 提示词日志记录 – 通过历史记录、统计数据和分析跟踪所有提示词

  • 💰 成本优化 – 根据偏好选择旗舰模型或更经济的模型

  • ⚡ 轻松设置 – 在 Cursor 中一键安装或简单的手动设置

  • 🔄 调用所有 LLM – 同时从所有提供商获取响应

Related MCP server: OpenRouter MCP Server

快速入门

准备好访问多个 LLM 了吗?几秒钟即可安装:

在 Cursor 中安装(推荐):

🔗 在 Cursor 中安装

或者手动安装:

npm install -g cross-llm-mcp
# Or from source:
git clone https://github.com/JamesANZ/cross-llm-mcp.git
cd cross-llm-mcp && npm install && npm run build

功能

🤖 单个 LLM 工具

  • call-chatgpt – OpenAI 的 ChatGPT API

  • call-claude – Anthropic 的 Claude API

  • call-deepseek – DeepSeek API

  • call-gemini – Google 的 Gemini API

  • call-grok – xAI 的 Grok API

  • call-kimi – Moonshot AI 的 Kimi API

  • call-perplexity – Perplexity AI API

  • call-mistral – Mistral AI API

  • call-huggingface – Hugging Face 推理路由器(兼容 OpenAI 的 Hub 模型)

🔄 组合工具

  • call-all-llms – 使用相同的提示词调用所有 LLM

  • call-llm – 按名称调用特定的提供商

⚙️ 偏好设置与模型选择

  • get-user-preferences – 获取当前偏好设置

  • set-user-preferences – 设置默认模型、成本偏好和基于标签的偏好

  • get-models-by-tag – 按标签查找模型(编码、商业、推理、数学、创意、通用)

📝 提示词日志记录

  • get-prompt-history – 查看带有过滤器的提示词历史记录

  • get-prompt-stats – 获取关于提示词日志的统计信息

  • delete-prompt-entries – 按条件删除日志条目

  • clear-prompt-history – 清除所有提示词日志

安装

Cursor(一键安装)

点击上面的安装链接或使用:

cursor://anysphere.cursor-deeplink/mcp/install?name=cross-llm-mcp&config=eyJjcm9zcy1sbG0tbWNwIjp7ImNvbW1hbmQiOiJucHgiLCJhcmdzIjpbIi15IiwiY3Jvc3MtbGxtLW1jcCJdfX0=

安装后,在 Cursor 设置中添加您的 API 密钥(请参阅下方的配置)。

手动安装

要求: Node.js 18+ 和 npm

# Clone and build
git clone https://github.com/JamesANZ/cross-llm-mcp.git
cd cross-llm-mcp
npm install
npm run build

Claude Desktop

添加到 claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cross-llm-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/cross-llm-mcp/build/index.js"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key_here",
        "ANTHROPIC_API_KEY": "your_anthropic_api_key_here",
        "DEEPSEEK_API_KEY": "your_deepseek_api_key_here",
        "GEMINI_API_KEY": "your_gemini_api_key_here",
        "XAI_API_KEY": "your_grok_api_key_here",
        "KIMI_API_KEY": "your_kimi_api_key_here",
        "PERPLEXITY_API_KEY": "your_perplexity_api_key_here",
        "MISTRAL_API_KEY": "your_mistral_api_key_here",
        "HF_TOKEN": "your_huggingface_token_here"
      }
    }
  }
}

配置后重启 Claude Desktop。

配置

API 密钥

为您想要使用的 LLM 提供商设置环境变量:

export OPENAI_API_KEY="your_openai_api_key"
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export DEEPSEEK_API_KEY="your_deepseek_api_key"
export GEMINI_API_KEY="your_gemini_api_key"
export XAI_API_KEY="your_grok_api_key"
export KIMI_API_KEY="your_kimi_api_key"
export PERPLEXITY_API_KEY="your_perplexity_api_key"
export MISTRAL_API_KEY="your_mistral_api_key"
export HF_TOKEN="your_huggingface_token"
# Or: HUGGINGFACE_API_KEY (same as HF_TOKEN)
# Optional: DEFAULT_HUGGINGFACE_MODEL, HUGGINGFACE_INFERENCE_BASE_URL (default https://router.huggingface.co/v1)

获取 API 密钥

在本地运行 Hub 模型(在此 MCP 之外)

此服务器调用 Hugging Face 的 托管 推理路由器;它不会在 Node 内部下载权重或运行 PyTorch/GGUF。要在您的机器上运行模型,请使用 Ollama、llama.cpp、Text Generation Inference 或 Hugging Face Inference Endpoints 等工具,如果它们公开了 API,则将其他客户端指向这些服务。

使用示例

调用 ChatGPT

从 OpenAI 获取响应:

{
  "tool": "call-chatgpt",
  "arguments": {
    "prompt": "Explain quantum computing in simple terms",
    "temperature": 0.7,
    "max_tokens": 500
  }
}

调用 Hugging Face

通过推理路由器从 Hub 模型获取响应(model 是 Hub 仓库 ID,例如 Qwen/Qwen2.5-7B-Instruct):

{
  "tool": "call-huggingface",
  "arguments": {
    "prompt": "Reply with exactly: ok",
    "model": "Qwen/Qwen2.5-7B-Instruct",
    "temperature": 0.3,
    "max_tokens": 32
  }
}

调用所有 LLM

从所有提供商获取响应:

{
  "tool": "call-all-llms",
  "arguments": {
    "prompt": "Write a short poem about AI",
    "temperature": 0.8
  }
}

设置基于标签的偏好

自动为每种任务类型使用最佳模型:

{
  "tool": "set-user-preferences",
  "arguments": {
    "defaultModel": "gpt-4o",
    "costPreference": "cheaper",
    "tagPreferences": {
      "coding": "deepseek-r1",
      "general": "gpt-4o",
      "business": "claude-3.5-sonnet-20241022",
      "reasoning": "deepseek-r1",
      "math": "deepseek-r1",
      "creative": "gpt-4o"
    }
  }
}

获取提示词历史记录

查看您的提示词日志:

{
  "tool": "get-prompt-history",
  "arguments": {
    "provider": "chatgpt",
    "limit": 10
  }
}

模型标签

模型按其优势进行标记:

  • coding: deepseek-r1, deepseek-coder, gpt-4o, claude-3.5-sonnet-20241022

  • business: claude-3-opus-20240229, gpt-4o, gemini-1.5-pro

  • reasoning: deepseek-r1, o1-preview, claude-3.5-sonnet-20241022

  • math: deepseek-r1, o1-preview, o1-mini

  • creative: gpt-4o, claude-3-opus-20240229, gemini-1.5-pro

  • general: gpt-4o-mini, claude-3-haiku-20240307, gemini-1.5-flash

使用场景

  • 多视角分析 – 从多个 LLM 获取不同视角

  • 模型比较 – 比较响应以了解优势和劣势

  • 成本优化 – 为每个任务选择最具成本效益的模型

  • 质量保证 – 交叉参考来自多个模型的响应

  • 智能选择 – 自动为编码、商业、推理等任务使用最佳模型

  • 提示词分析 – 通过自动日志记录跟踪使用情况、成本和模式

技术细节

构建于: Node.js, TypeScript, MCP SDK
依赖: @modelcontextprotocol/sdk, superagent, zod
平台: macOS, Windows, Linux

偏好存储:

  • Unix/macOS: ~/.cross-llm-mcp/preferences.json

  • Windows: %APPDATA%/cross-llm-mcp/preferences.json

提示词日志存储:

  • Unix/macOS: ~/.cross-llm-mcp/prompts.json

  • Windows: %APPDATA%/cross-llm-mcp/prompts.json

贡献

⭐ 如果这个项目对您有帮助,请在 GitHub 上给它加星! ⭐

欢迎贡献!请提交 issue 或 pull request。

许可证

MIT 许可证 – 详情请参阅 LICENSE.md。

支持

如果您觉得这个项目有用,请考虑支持它:

⚡ Lightning Network

lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa

₿ Bitcoin: bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp

Ξ Ethereum/EVM: 0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f

Available Tools

7 tools
decode_invoiceC

Decode a Lightning invoice

Inputs: invoice (required).

decode_txC

Decode a Bitcoin transaction

Inputs: rawHex (required).

generate_keyB

Generate a new Bitcoin key pair and address

Inputs: no named parameters.

get_latest_blockC

Get the latest block

Inputs: no named parameters.

get_transactionC

Get transaction details

Inputs: txid (required).

pay_invoiceC

Pay a Lightning invoice

Inputs: invoice (required).

validate_addressC

Validate a Bitcoin address

Inputs: address (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific resources and actions in the Bitcoin/Lightning domain. For example, decode_invoice and pay_invoice handle Lightning payments, while decode_tx and get_transaction handle Bitcoin transactions, with no overlapping functionality that would cause confusion.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as decode_invoice, generate_key, and validate_address. This uniformity makes the tool set predictable and easy to understand for agents.

    Tool Count5/5

    With 7 tools, the server is well-scoped for its purpose of Bitcoin and Lightning operations. Each tool serves a specific, necessary function without redundancy, making the count appropriate for the domain's core needs.

    Completeness4/5

    The tool set covers key operations like decoding, generating, validating, and paying, but there are minor gaps such as creating invoices or managing wallet balances. However, agents can still perform essential workflows with the provided tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      A unified Model Context Protocol server that aggregates multiple MCP servers into one, allowing AI assistants like Claude Desktop, Cursor, and Cherry Studio to connect to a single server instead of managing multiple instances.
      1,121 npm
      534
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that bridges MCP clients with local LLM services, enabling seamless integration with MCP-compatible applications through standard tools like chat completion, model listing, and health checks.
      -