Multi-AI MCP for Claude Code

repository·main·Indexed 41 days ago

https://github.com/raiansar/claude_code-multi-ai-mcp

An MCP (Model Context Protocol) server that enables Claude Code to interact with multiple AI models—including Gemini, Grok-3, ChatGPT, and DeepSeek—simultaneously. It provides tools for multi-perspective opinions via `ask_all_ais`, structured technical debates with `ai_debate`, and specialized code reviews using model-specific tools like `gemini_code_review` and `openai_code_review`.

Tokens
2.9K
Snippets
8
Records
14
Agent score
100%

What's inside Multi-AI MCP

  1. Choose the right AI for specific tasks

    main

    While you can ask for 'all AIs' to get a comprehensive view, you can also target specific models based on their perceived strengths:

    • Gemini: Best for technical deep-dives, algorithm complexity analysis, database design, and detailed technical explanations.
    • Grok: Best for creative solutions, unconventional approaches, brainstorming, and unique perspectives.
    • ChatGPT: Best for balanced analysis, practical advice, and providing code examples for patterns.
    • DeepSeek: Best for mathematical problems, advanced coding challenges, and optimizing algorithm performance.
  2. Install the Multi-AI MCP for Claude Code

    main

    To connect Claude Code to Gemini, Grok-3, ChatGPT, and DeepSeek, follow these steps:

    1. Clone the repository:

      git clone https://github.com/RaiAnsar/claude_code-multi-AI-MCP.git
      cd claude_code-multi-AI-MCP
    2. Run the automatic setup: The setup.sh script will handle the installation and prompt you for your API keys.

      chmod +x setup.sh
      ./setup.sh
    3. Provide API Keys: During setup, you will be asked for keys for the services you wish to use:

    Note: You do not need all keys. The server automatically adapts to only the AIs you have configured.

    git clone https://github.com/RaiAnsar/claude_code-multi-AI-MCP.git
    cd claude_code-multi-AI-MCP
    chmod +x setup.sh
    ./setup.sh
  3. Use advanced multi-AI workflows

    main

    Beyond simple questions, you can orchestrate complex workflows by chaining requests to different models:

    The Multi-AI Review Method

    Use this to validate a design or piece of code through multiple lenses:

    1. Ask Gemini to design a system.
    2. Ask ChatGPT to review that design for issues.
    3. Ask DeepSeek to analyze the logic and security.
    4. Ask Grok for creative improvements.

    The Debate & Decide Method

    Use this for high-stakes architectural decisions:

    1. Have Gemini and Grok debate two different technologies (e.g., REST vs GraphQL).
    2. Have DeepSeek analyze the performance implications of the debate.
    3. Ask ChatGPT to summarize the findings and provide a final recommendation.

    The Perspective Gathering Method

    Use this when stuck on a complex problem:

    • Ask all AIs for their different approaches, then ask Claude to help you combine the best ideas into a single solution.
  4. Use Multi-AI tools via natural language in Claude Code

    main

    Once installed, you don't need to remember specific commands. You can simply ask Claude Code to perform tasks using the integrated AI tools. The server provides several specialized tools that Claude will invoke based on your request:

    • Get multiple opinions: Ask Claude to use ask_all_ais to get perspectives from all enabled AIs.
    • Debug code: Ask Claude to use grok_debug or other debug tools for specific models.
    • Debate topics: Ask Claude to use ai_debate to have two AIs (e.g., Gemini and ChatGPT) argue a technical decision.
    • Code reviews: Ask for reviews using tools like gemini_code_review, openai_code_review, or grok_code_review with specific focuses (e.g., 'technical accuracy' or 'best practices').
    • Brainstorming: Use tools like grok_brainstorm for creative input.
    • Architecture: Use gemini_architecture for design recommendations.
  5. Configure API keys and models in credentials.json

    main

    You can manage your AI providers, specific models, and enable/disable them by editing the credentials.json file located at ~/.claude-mcp-servers/multi-ai-collab/credentials.json.

    Supported keys per provider:

    • api_key: Your provider's API key.
    • model: The specific model string to use (e.g., gemini-2.0-flash, grok-3, gpt-4o).
    • enabled: A boolean to turn the provider on or off.
    {
      "gemini": {
        "api_key": "your-gemini-key",
        "model": "gemini-2.0-flash",
        "enabled": true
      },
      "grok": {
        "api_key": "your-grok-key",
        "model": "grok-3",
        "enabled": true
      },
      "openai": {
        "api_key": "your-openai-key",
        "model": "gpt-4o",
        "enabled": true
      }
    }
  6. Troubleshoot Multi-AI MCP installation

    main

    If you encounter issues with the Multi-AI MCP, use the following steps:

    Verify MCP visibility: Run claude mcp list. You should see multi-ai-collab in the list.

    Check server status: If an AI is not responding, run mcp__multi-ai-collab__server_status to check which AIs are enabled and working.

    Fix connection errors:

    • Verify your API keys are correct in ~/.claude-mcp-servers/multi-ai-collab/credentials.json.
    • Ensure you have sufficient API credits for the respective services.

    Perform a clean reinstall: If the installation is corrupted, remove it and run the setup again:

    claude mcp remove multi-ai-collab
    ./setup.sh
    claude mcp list
    mcp__multi-ai-collab__server_status
    claude mcp remove multi-ai-collab
    ./setup.sh
  7. Common usage patterns for debugging and code review

    main

    You can use the multi-AI setup for several common developer tasks:

    • Debugging: Ask all AIs for thoughts on a performance issue, or target a specific AI (like Grok) to debug a failing function.
    • Code Reviews: Ask all AIs to review a function for security issues, or ask a specific AI (like Gemini) to review a database query for performance bottlenecks.
    • Learning: Ask all AIs to explain a new technology (like Docker) to see different pedagogical styles (technical, creative, balanced, or mathematical).
    • Brainstorming: Ask Grok specifically to brainstorm creative or 'wild' features for an application.
  8. Reference: Multi-AI MCP Tools and Advanced Parameters

    main

    The following tool patterns are available for advanced usage within Claude Code. Note that tool names follow the pattern mcp__multi-ai-collab__[tool_name] when called via MCP.

    General Prompting & Temperature

    You can control the creativity of responses by passing a temperature parameter (0.0 to 1.0):

    • ask_gemini(prompt, temperature)
    • ask_openai(prompt, temperature)
    • ask_grok(prompt, temperature)

    Specialized Code Reviews

    Each provider has a specialized review tool with a focus parameter:

    • gemini_code_review(code, focus): e.g., focus: "technical accuracy"
    • openai_code_review(code, focus): e.g., focus: "best practices"
    • grok_code_review(code, focus): e.g., focus: "alternative approaches"

    Multi-AI Workflow Tools

    • ask_all_ais(prompt): Queries all enabled AIs.
    • ai_debate(topic, ai1, ai2): Sets up a debate between two specific AIs (e.g., ai1: "gemini", ai2: "openai").
    # Example: Technical explanation with low temperature
    mcp__multi-ai-collab__ask_grok
      prompt: "Explain how TCP/IP works"
      temperature: 0.2
    
    # Example: Specialized Code Review
    mcp__multi-ai-collab__gemini_code_review
      code: "[your code]"
      focus: "technical accuracy"
  9. Use the `ask_all_ais` tool for comparative analysis

    main

    To get multiple perspectives on a single prompt, use the ask_all_ais tool. This will trigger a request to every currently configured and enabled AI model and return a formatted report containing all responses.

    Arguments:

    • prompt (string, required): The question or instruction.
    • temperature (number, optional): Controls randomness (0.0-1.0, default: 0.7).
    {
      "method": "tools/call",
      "params": {
        "name": "ask_all_ais",
        "arguments": {
          "prompt": "What are the pros and cons of using microservices?",
          "temperature": 0.7
        }
      }
    }
  10. Use the `ai_debate` tool to compare viewpoints

    main

    The ai_debate tool facilitates a structured debate between two AI models. One AI presents an opening argument in favor of a topic, and the second presents a counter-argument.

    Arguments:

    • topic (string, required): The subject of the debate.
    • ai1 (string, optional): The first AI (e.g., gemini, grok, openai, deepseek). Defaults to gemini.
    • ai2 (string, optional): The second AI. Defaults to grok.
    {
      "method": "tools/call",
      "params": {
        "name": "ai_debate",
        "arguments": {
          "topic": "Is AI-driven coding a threat to junior developers?",
          "ai1": "openai",
          "ai2": "deepseek"
        }
      }
    }
  11. Check server status and available models

    main

    Use the server_status tool to verify which AI models are correctly configured and ready for use. It returns the server version, a list of ready AIs, and a list of disabled or unavailable models.

    {
      "method": "tools/call",
      "params": {
        "name": "server_status"
      }
    }