Skip to content
MCP server

Stackexchange MCP

Search Stack Overflow and other Stack Exchange sites from an AI assistant, read-only

Runs locally

Stackexchange MCP is an MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Platforms
CLI
Runs
Locally
What it can do
Read-only
Access
Needs a secret key or token
Version
0.1.0
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add stackexchange-mcp --env YOUR_API_KEY='<YOUR_API_KEY>' -- uvx stackexchange-mcp

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "stackexchange-mcp": {
      "command": "uvx",
      "args": [
        "stackexchange-mcp"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "stackexchange-mcp": {
      "command": "uvx",
      "args": [
        "stackexchange-mcp"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "stackexchange-mcp": {
      "command": "uvx",
      "args": [
        "stackexchange-mcp"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "stackexchange-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "stackexchange-mcp"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add stackexchange-mcp --env YOUR_API_KEY='<YOUR_API_KEY>' -- uvx stackexchange-mcp

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.stackexchange-mcp]
command = "uvx"
args = ["stackexchange-mcp"]
env = { YOUR_API_KEY = "<YOUR_API_KEY>" }

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "stackexchange-mcp": {
      "command": "uvx",
      "args": [
        "stackexchange-mcp"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Or run: gemini mcp add -s user -e YOUR_API_KEY='<YOUR_API_KEY>' stackexchange-mcp uvx -- stackexchange-mcp

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "stackexchange-mcp": {
          "command": "uvx",
          "args": [
            "stackexchange-mcp"
          ],
          "env": {
            "YOUR_API_KEY": "<YOUR_API_KEY>"
          }
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

  • YOUR_API_KEYYour API key for the serviceRequired

About Stackexchange MCP

Instead of letting a model guess at an error, this server lets it look up voted answers. Six tools cover searching questions, reading a question with its best answers, searching by pasted error message, looking up exact tag names, getting a tag overview and checking remaining API quota.

Some care went into the details. Error searches strip file paths, line numbers and addresses before querying, bodies are converted to Markdown and truncated at 2,000 characters by default, identical requests are cached for five minutes, and calls are spaced at least 0.2 seconds apart with retries on timeouts and 5xx responses. Results include author, link and licence, since Stack Exchange posts are CC BY-SA.

It also ships three prompts (debug_error, compare_approaches, tag_primer) and resources for site slugs and quota. The registry's placeholder text is unfinished, but the README documents the real behaviour. It is unaffiliated with Stack Exchange, Inc.

Tools this server provides (6)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, all 6 tools only read data.

From the server's own tool labels and tool names; not verified by us.

search_questionsName suggests: reads
Finds discussions by topic, with tag, site and sort filters.
get_questionName suggests: reads
Reads one question with its best answers.
search_by_error_messageName suggests: reads
Finds threads for a pasted error or stack trace.
search_tagsName suggests: reads
Finds exact tag names.
get_tag_overviewName suggests: reads
Gives a technology's summary and top questions.
get_quota_statusName suggests: reads
Shows remaining API quota and rate-limit waits.

What it does

Error-message search
Strips paths and line numbers from a trace before searching.
Question and answers
Reads a thread with the accepted answer first.
Tag lookup
Finds exact tags and summarises a technology.
Quota awareness
Tracks the daily limit and waits out backoff requests.
Attribution built in
Returns author, link and licence for each post.

Good for

  • Find a fix for a pasted stack trace
  • Compare two approaches using highly voted discussions
  • Get a beginner overview of a technology from its tag
  • Search Server Fault or other Stack Exchange sites

Pricing

Pricing unknown

Stack Exchange API keys are free

Stackexchange MCP FAQ

Does Stackexchange MCP need an API key?

No, but anonymous use is about 300 requests a day against 10,000 with a free key.

Can Stackexchange MCP post or vote?

No. It is read-only.

How do I run Stackexchange MCP?

With uvx stackexchange-mcp, launched by your MCP client.

How long are answers?

Bodies are cut at 2,000 characters by default, adjustable with SE_MAX_BODY_CHARS.

How do I add Stackexchange MCP to Claude Code?

Run this command in your terminal: claude mcp add stackexchange-mcp --env YOUR_API_KEY='<YOUR_API_KEY>' -- uvx stackexchange-mcp

What are the best alternatives to Stackexchange MCP?

The closest alternatives to Stackexchange MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers