Consult LLM MCP server

Escalates complex reasoning tasks to more powerful language models (OpenAI o3, Google Gemini 2.5 Pro, DeepSeek Reasoner) by forwarding markdown prompts with code context and git diffs, returning responses with detailed cost tracking.
Back to servers
Setup instructions
Provider
raine
Release date
Jun 23, 2025
Language
Go
Stats
16 stars

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.

Installation

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

Configuration Options

Configure the server with these environment variables:

  • OPENAI_API_KEY - Required for using the o3 model
  • GEMINI_API_KEY - Required for Gemini models in API mode
  • DEEPSEEK_API_KEY - Required for DeepSeek models
  • CONSULT_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 models

Using the Consult LLM Tool

The server provides a single MCP tool called consult_llm with these parameters:

Parameters

  • prompt (required): Your question or request
  • files (optional): Array of file paths to include as context
  • model (optional): LLM model to use (o3, gemini-2.5-pro, deepseek-reasoner)
  • git_diff (optional): Include git diff output as context
    • files: Specific files to include in diff
    • repo_path: Path to git repository (defaults to current directory)
    • base_ref: Git reference to compare against (defaults to HEAD)

Supported Models

  • o3: OpenAI's reasoning model ($2/$8 per million tokens)
  • gemini-2.5-pro: Google's Gemini 2.5 Pro ($1.25/$10 per million tokens)
  • deepseek-reasoner: DeepSeek's reasoning model ($0.55/$2.19 per million tokens)

Usage Examples

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?

Logging

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.

Adding to CLAUDE.md

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later