Get the FREE Ultimate OpenClaw Setup Guide →

stackoverflow

A Model Context Protocol server for querying Stack Overflow to help AI models find programming solutions

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gscalzo-stackoverflow-mcp npx -y @gscalzo/stackoverflow-mcp \
  --env STACKOVERFLOW_API_KEY="your-api-key-optional"

How to use

This MCP server provides a Stack Overflow search interface tailored for AI-assisted programming help. It exposes three main tools: search_by_error, search_by_tags, and analyze_stack_trace. You can query error messages to find relevant questions and answers, search by programming language or tags to surface related discussions, and analyze stack traces to extract potential solutions. Results can be returned in JSON or Markdown format depending on the request, and you can filter results by score, include comments, and control the number of results returned. If you want to increase request throughput, supply a Stack Overflow API key in the MCP settings to elevate rate limits.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to run npm with npx or npm install -g

Installation options:

  1. Run directly with npx (no local install):
npx -y @gscalzo/stackoverflow-mcp
  1. Install globally with npm (optional):
npm install -g @gscalzo/stackoverflow-mcp

Configure the MCP server in your MCP settings file (examples shown in the README):

{
  "mcpServers": {
    "stackoverflow": {
      "command": "npx",
      "args": ["-y", "@gscalzo/stackoverflow-mcp"],
      "env": {
        "STACKOVERFLOW_API_KEY": "your-api-key-optional"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Optional: place the config in the designated MCP settings path used by your environment (as shown in the README) and include your API key if you have one.

Additional notes

Notes:

  • The server can operate without authentication but is rate-limited; providing a Stack Overflow API key increases limits.
  • You can choose output format per request (JSON or Markdown).
  • If you encounter network or API issues, verify that the API key (if set) is valid and that the host can reach stackoverflow endpoints.
  • The MCP setting supports typical fields like disabled and autoApprove; adjust as needed for your environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers