This document provides examples of how to use the Cross-LLM MCP Server with different MCP clients.
Copy the example environment file and add your API keys:
cp env.example .envEdit .env with your actual API keys:
# OpenAI/ChatGPT API Key
OPENAI_API_KEY=sk-your-openai-key-here
# Anthropic/Claude API Key
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
# DeepSeek API Key
DEEPSEEK_API_KEY=sk-your-deepseek-key-here
# Default models (optional)
DEFAULT_CHATGPT_MODEL=gpt-4
DEFAULT_CLAUDE_MODEL=claude-3-sonnet-20240229
DEFAULT_DEEPSEEK_MODEL=deepseek-chat
# Hugging Face Inference Router (Hub model ids; token needs Inference access)
HF_TOKEN=hf_your_token_here
# DEFAULT_HUGGINGFACE_MODEL=Qwen/Qwen2.5-7B-Instructnpm run build- Open Claude Desktop
- Go to Settings → Model Context Protocol
- Add a new server with these settings:
- Name: Cross-LLM
- Command:
node - Arguments:
[path-to-your-project]/build/index.js - Working Directory:
[path-to-your-project]
User: "Call ChatGPT to explain quantum computing"
Claude: I'll use the Cross-LLM MCP server to call ChatGPT for you.
{
"tool": "call-chatgpt",
"arguments": {
"prompt": "Explain quantum computing in simple terms",
"temperature": 0.7,
"max_tokens": 500
}
}{
"tool": "call-huggingface",
"arguments": {
"prompt": "What is 2+2? Reply with one word.",
"model": "Qwen/Qwen2.5-7B-Instruct",
"max_tokens": 50
}
}User: "Get responses from all LLMs about the future of AI"
Claude: I'll call all available LLMs to get different perspectives.
{
"tool": "call-all-llms",
"arguments": {
"prompt": "What do you think the future of artificial intelligence will look like in the next 10 years?",
"temperature": 0.8,
"max_tokens": 800
}
}User: "Ask Claude to write a poem about technology"
Claude: I'll call the Claude API specifically for this request.
{
"tool": "call-claude",
"arguments": {
"prompt": "Write a short poem about the impact of technology on modern life",
"model": "claude-3-sonnet-20240229",
"temperature": 0.9,
"max_tokens": 300
}
}You can specify different models for each provider:
{
"tool": "call-llm",
"arguments": {
"provider": "chatgpt",
"prompt": "Explain machine learning algorithms",
"model": "gpt-4-turbo",
"temperature": 0.5,
"max_tokens": 1000
}
}Adjust creativity vs consistency:
- Low temperature (0.1-0.3): More focused, consistent responses
- Medium temperature (0.4-0.7): Balanced creativity and consistency
- High temperature (0.8-1.0): More creative, varied responses
Control response length:
- Short responses: 100-300 tokens
- Medium responses: 500-800 tokens
- Long responses: 1000+ tokens
The server provides clear error messages for common issues:
**ChatGPT Error:** OpenAI API key not configured
**Claude Error:** Claude API error: Network timeout
**DeepSeek Error:** DeepSeek API error: Rate limit exceeded
- Start with individual calls to test each LLM before using
call-all-llms - Use appropriate temperature for your use case
- Monitor token usage to manage costs
- Handle errors gracefully - one LLM failure shouldn't stop your workflow
- Compare responses to understand different model strengths
- Check that all dependencies are installed:
npm install - Verify the build was successful:
npm run build - Ensure the
.envfile exists and has valid API keys
- Verify your API keys are correct and active
- Check your API usage limits and billing status
- Ensure you're using supported model names
- Check that at least one API key is configured
- Verify network connectivity
- Look for error messages in the response
The server integrates seamlessly with Claude Desktop, allowing you to:
- Call other LLMs while chatting with Claude
- Compare responses from different models
- Use specialized models for specific tasks
Any MCP-compatible client can use this server to:
- Access multiple LLM providers
- Get diverse perspectives on topics
- Build more robust AI applications