# Stackexchange MCP

> Stackexchange MCP is an MCP server for developer tools. Search Stack Overflow and other Stack Exchange sites from an AI assistant, read-only. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI
- **Repository:** https://github.com/yashlimbani/stackexchange-mcp
- **MCP Registry name:** io.github.YashLimbani/stackexchange-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

```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.

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

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

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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.

### Devin Desktop (~/.config/devin/mcp_config.json)

```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.

### Cline (cline_mcp_settings.json)

```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.

### Zed (Zed settings.json)

```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.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "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.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```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.

### Kiro (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

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_questions` (name suggests: reads): Finds discussions by topic, with tag, site and sort filters.
- `get_question` (name suggests: reads): Reads one question with its best answers.
- `search_by_error_message` (name suggests: reads): Finds threads for a pasted error or stack trace.
- `search_tags` (name suggests: reads): Finds exact tag names.
- `get_tag_overview` (name suggests: reads): Gives a technology's summary and top questions.
- `get_quota_status` (name suggests: reads): Shows remaining API quota and rate-limit waits.

## 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.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/stackexchange-mcp-2
