The Consult LLM MCP server allows Claude Code to access more powerful AI models like o3, Gemini 2.5 Pro, and DeepSeek Reasoner when you need advanced assistance with complex problems. It provides a simple way to query these models with relevant files as context, making it easy to get high-quality AI help directly within your workflow.
Add the MCP server to Claude Code with one of these commands:
claude mcp add consult-llm -- npx -y consult-llm-mcp
For global availability across all projects:
claude mcp add --scope user consult-llm -- npx -y consult-llm-mcp
You can also provide API keys and configuration directly in the command:
claude mcp add \
-e OPENAI_API_KEY=your_openai_key \
-e GEMINI_API_KEY=your_gemini_key \
-e DEEPSEEK_API_KEY=your_deepseek_key \
-e GEMINI_MODE=cli \
consult-llm -- npx -y consult-llm-mcp
Configure the server with these environment variables:
OPENAI_API_KEY
- Required for using the o3 modelGEMINI_API_KEY
- Required for Gemini models in API modeDEEPSEEK_API_KEY
- Required for DeepSeek modelsCONSULT_LLM_DEFAULT_MODEL
- Change the default model (options: o3
, gemini-2.5-pro
, deepseek-reasoner
)GEMINI_MODE
- Choose between api
(default) or cli
mode for Gemini modelsThe server provides a single MCP tool called consult_llm
with these parameters:
o3
, gemini-2.5-pro
, deepseek-reasoner
)Ask Claude Code to consult a more powerful model:
This SQL query is timing out on large datasets. Can you help optimize it? Ask Gemini
For debugging complex issues:
I'm getting this error when running my React application. Can you consult a more powerful model to help debug it?
For code optimization:
This function is slow with large datasets. Can you consult o3 to suggest optimizations?
All prompts and responses are logged to ~/.consult-llm-mcp/logs/mcp.log
with token usage and cost estimates, which helps you track your API usage.
You can optionally add this to your project's CLAUDE.md
file to help Claude Code understand when to use this tool:
## consult-llm-mcp
Use the `consult_llm` MCP tool to ask a more powerful AI for help with complex problems. Include files to git_diff when asking feedback for changes.
Use Gemini 2.5 Pro.
CRITICAL: When asking, don't present options, this will bias the answer.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "consult-llm" '{"command":"npx","args":["-y","consult-llm-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"consult-llm": {
"command": "npx",
"args": [
"-y",
"consult-llm-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"consult-llm": {
"command": "npx",
"args": [
"-y",
"consult-llm-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect