Get the FREE Ultimate OpenClaw Setup Guide →

second-opinion

MCP server from PoliTwit1984/second-opinion-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio politwit1984-second-opinion-mcp-server node /path/to/second-opinion-server/build/index.js \
  --env GEMINI_API_KEY="your-gemini-api-key" \
  --env PERPLEXITY_API_KEY="your-perplexity-api-key" \
  --env STACK_EXCHANGE_KEY="your-stack-exchange-key"

How to use

Second Opinion is an MCP server that provides AI-powered coding problem guidance by integrating insights from Google Gemini, Stack Exchange accepted answers, and Perplexity AI analysis. It automatically detects the language from file extensions, extracts and formats relevant code snippets, and can generate Markdown-style reports with the proposed solutions. It also gathers contextual file information from your Git workspace to improve relevance and accuracy. The server exposes a single tool named get_second_opinion, which you can invoke with a structured input describing your coding goal, any errors, code context, attempts already made, and the file path if applicable.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to the internet to install dependencies
  • API keys for Gemini, Perplexity, and Stack Exchange (as required by the server)

Install and build:

  1. Install dependencies
npm install
  1. Build the server
npm run build
  1. Configure MCP settings for the server (example):
{
  "mcpServers": {
    "second-opinion": {
      "command": "node",
      "args": ["/path/to/second-opinion-server/build/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key",
        "PERPLEXITY_API_KEY": "your-perplexity-api-key",
        "STACK_EXCHANGE_KEY": "your-stack-exchange-key"
      }
    }
  }
}

Run the MCP configuration in your environment as appropriate for your setup. Ensure the paths and environment variables are correctly set before starting the server.

Additional notes

Notes and tips:

  • Ensure GEMINI_API_KEY, PERPLEXITY_API_KEY, and STACK_EXCHANGE_KEY are available in the MCP environment where the server runs. STACK_EXCHANGE_KEY is optional if you are okay with anonymous access.
  • The server automatically detects language from file extensions to tailor the analysis and formatting.
  • The get_second_opinion tool returns a structured solution that includes code snippets, explanations, and a Markdown-formatted report where appropriate.
  • If you update the server, rebuild with npm run build and refresh the MCP configuration to point to the new build/index.js path.
  • Check the Known Issues or errors.md in the repo if you encounter integration problems with external AI services.

Related MCP Servers

Sponsor this space

Reach thousands of developers