A Model Context Protocol (MCP) server that provides access to multiple Large Language Model (LLM) APIs including ChatGPT, Claude, and DeepSeek. This allows you to call different LLMs from within any MCP-compatible client and combine their responses.
This MCP server offers five specialized tools for interacting with different LLM providers:
Call OpenAI's ChatGPT API with a prompt.
Input:
prompt
(string): The prompt to send to ChatGPTmodel
(optional, string): ChatGPT model to use (default: gpt-4)temperature
(optional, number): Temperature for response randomness (0-2, default: 0.7)max_tokens
(optional, number): Maximum tokens in response (default: 1000)
Output:
- ChatGPT response with model information and token usage statistics
Example:
ChatGPT Response
Model: gpt-4
Here's a comprehensive explanation of quantum computing...
---
Usage:
- Prompt tokens: 15
- Completion tokens: 245
- Total tokens: 260
Call Anthropic's Claude API with a prompt.
Input:
prompt
(string): The prompt to send to Claudemodel
(optional, string): Claude model to use (default: claude-3-sonnet-20240229)temperature
(optional, number): Temperature for response randomness (0-1, default: 0.7)max_tokens
(optional, number): Maximum tokens in response (default: 1000)
Output:
- Claude response with model information and token usage statistics
Call DeepSeek API with a prompt.
Input:
prompt
(string): The prompt to send to DeepSeekmodel
(optional, string): DeepSeek model to use (default: deepseek-chat)temperature
(optional, number): Temperature for response randomness (0-2, default: 0.7)max_tokens
(optional, number): Maximum tokens in response (default: 1000)
Output:
- DeepSeek response with model information and token usage statistics
Call all available LLM APIs (ChatGPT, Claude, DeepSeek) with the same prompt and get combined responses.
Input:
prompt
(string): The prompt to send to all LLMstemperature
(optional, number): Temperature for response randomness (0-2, default: 0.7)max_tokens
(optional, number): Maximum tokens in response (default: 1000)
Output:
- Combined responses from all LLMs with individual model information and usage statistics
- Summary of successful responses and total tokens used
Example:
Multi-LLM Response
Prompt: Explain quantum computing in simple terms
---
## CHATGPT
Model: gpt-4
Quantum computing is like having a super-powered computer...
---
## CLAUDE
Model: claude-3-sonnet-20240229
Quantum computing represents a fundamental shift...
---
## DEEPSEEK
Model: deepseek-chat
Quantum computing harnesses the principles of quantum mechanics...
---
Summary:
- Successful responses: 3/3
- Total tokens used: 1250
Call a specific LLM provider by name.
Input:
provider
(string): The LLM provider to call ("chatgpt", "claude", or "deepseek")prompt
(string): The prompt to send to the LLMmodel
(optional, string): Model to use (uses provider default if not specified)temperature
(optional, number): Temperature for response randomness (0-2, default: 0.7)max_tokens
(optional, number): Maximum tokens in response (default: 1000)
Output:
- Response from the specified LLM with model information and usage statistics
- Clone this repository:
git clone <repository-url>
cd cross-llm-mcp
- Install dependencies:
npm install
- Set up environment variables:
cp env.example .env
- Edit the
.env
file with your API keys:
# OpenAI/ChatGPT API Key
OPENAI_API_KEY=your_openai_api_key_here
# Anthropic/Claude API Key
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# DeepSeek API Key
DEEPSEEK_API_KEY=your_deepseek_api_key_here
# Default models for each provider
DEFAULT_CHATGPT_MODEL=gpt-4
DEFAULT_CLAUDE_MODEL=claude-3-sonnet-20240229
DEFAULT_DEEPSEEK_MODEL=deepseek-chat
- Build the project:
npm run build
- Visit OpenAI Platform
- Sign up or log in to your account
- Create a new API key
- Add it to your
.env
file asOPENAI_API_KEY
- Visit Anthropic Console
- Sign up or log in to your account
- Create a new API key
- Add it to your
.env
file asANTHROPIC_API_KEY
- Visit DeepSeek Platform
- Sign up or log in to your account
- Create a new API key
- Add it to your
.env
file asDEEPSEEK_API_KEY
Start the MCP server:
npm start
The server runs on stdio and can be connected to any MCP-compatible client.
Here are some example queries you can make with this MCP server:
{
"tool": "call-chatgpt",
"arguments": {
"prompt": "Explain quantum computing in simple terms",
"temperature": 0.7,
"max_tokens": 500
}
}
{
"tool": "call-claude",
"arguments": {
"prompt": "What are the benefits of renewable energy?",
"model": "claude-3-sonnet-20240229"
}
}
{
"tool": "call-all-llms",
"arguments": {
"prompt": "Write a short poem about artificial intelligence",
"temperature": 0.8
}
}
{
"tool": "call-llm",
"arguments": {
"provider": "deepseek",
"prompt": "Explain machine learning algorithms",
"max_tokens": 800
}
}
Use call-all-llms
to get different perspectives on the same topic from multiple AI models.
Compare responses from different LLMs to understand their strengths and weaknesses.
If one LLM is unavailable, you can still get responses from other providers.
Choose the most cost-effective LLM for your specific use case.
Cross-reference responses from multiple models to validate information.
This MCP server uses the following API endpoints:
- OpenAI:
https://api.openai.com/v1/chat/completions
- Anthropic:
https://api.anthropic.com/v1/messages
- DeepSeek:
https://api.deepseek.com/v1/chat/completions
The server includes comprehensive error handling with detailed messages:
**ChatGPT Error:** OpenAI API key not configured
**Claude Error:** Claude API error: Invalid API key - please check your Anthropic API key
**DeepSeek Error:** DeepSeek API error: Rate limit exceeded - please try again later
**ChatGPT Error:** ChatGPT API error: Payment required - please check your OpenAI billing
**Claude Error:** Claude API error: Network timeout
OPENAI_API_KEY
: Your OpenAI API keyANTHROPIC_API_KEY
: Your Anthropic API keyDEEPSEEK_API_KEY
: Your DeepSeek API keyDEFAULT_CHATGPT_MODEL
: Default ChatGPT model (default: gpt-4)DEFAULT_CLAUDE_MODEL
: Default Claude model (default: claude-3-sonnet-20240229)DEFAULT_DEEPSEEK_MODEL
: Default DeepSeek model (default: deepseek-chat)
gpt-4
gpt-4-turbo
gpt-3.5-turbo
- And other OpenAI models
claude-3-sonnet-20240229
claude-3-opus-20240229
claude-3-haiku-20240307
- And other Anthropic models
deepseek-chat
deepseek-coder
- And other DeepSeek models
cross-llm-mcp/
├── src/
│ ├── index.ts # Main MCP server with all 5 tools
│ ├── types.ts # TypeScript type definitions
│ └── llm-clients.ts # LLM API client implementations
├── build/ # Compiled JavaScript output
├── env.example # Environment variables template
├── example-usage.md # Detailed usage examples
├── package.json # Project dependencies and scripts
└── README.md # This file
@modelcontextprotocol/sdk
- MCP SDK for server implementationsuperagent
- HTTP client for API requestszod
- Schema validation for tool parametersdotenv
- Environment variable management
npm run build
To add a new LLM provider:
- Add the provider type to
src/types.ts
- Implement the client in
src/llm-clients.ts
- Add the tool to
src/index.ts
- Update the
callAllLLMs
method to include the new provider
Server won't start
- Check that all dependencies are installed:
npm install
- Verify the build was successful:
npm run build
- Ensure the
.env
file exists and has valid API keys
API errors
- Verify your API keys are correct and active
- Check your API usage limits and billing status
- Ensure you're using supported model names
No responses
- Check that at least one API key is configured
- Verify network connectivity
- Look for error messages in the response
For debugging, you can run the server directly:
node build/index.js
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please:
- Check the troubleshooting section above
- Review the error messages for specific guidance
- Ensure your API keys are properly configured
- Verify your network connectivity