cyanheads avatar

Stackexchange Mcp Server

cyanheads/stackexchange-mcp-server

Wraps the Stack Exchange API to let Claude search questions, pull complete Q&A threads as markdown, browse tag FAQs, and look up user profiles across the entire network. The get_thread tool is the centerpiece: it fetches a question and all its answers in parallel, normalizes HTML to clean markdown, and sorts by accepted answer first. Built on the author's mcp-ts-core framework with backoff tracking and quota surfacing on every response so agents can plan around rate limits. Ships with a public hosted instance at stackexchange.caseyjhand.com, or run it locally via npx or Bun. Optional API key lifts the daily quota from 300 to 10,000 requests. Reach for this when you need programmatic access to Stack Overflow content with proper attribution.

GitHub stars
2
tools
5
transport
STDIO, HTTP
env vars
7
last updated
Oct 28, 2026

Install

From registry metadata
$ npx add-mcp https://stackexchange.caseyjhand.com/mcp --name stackexchange

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http stackexchange https://stackexchange.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 5 tools

Verified live against the running server on Nov 6, 2026.

stackexchange_list_sitesEnumerate all sites in the Stack Exchange network — name, api_site_parameter, audience, and URL. The api_site_parameter value is what other tools accept as the `site` input (e.g. "stackoverflow", "superuser", "serverfault"). Results are fetched live and optionally filtered by...1 params

Enumerate all sites in the Stack Exchange network — name, api_site_parameter, audience, and URL. The api_site_parameter value is what other tools accept as the `site` input (e.g. "stackoverflow", "superuser", "serverfault"). Results are fetched live and optionally filtered by...

Parameters* required
filterstring
Optional case-insensitive name filter — returns only sites whose name contains all provided tokens. Omit to return all sites.
stackexchange_search_questionsSearch questions across a Stack Exchange site. Returns ranked questions with title, score, answer count, accepted status, tags, ask and last-activity dates, and a short excerpt of the question body — not the full body. Results supply question_id values for stackexchange_get_th...8 params

Search questions across a Stack Exchange site. Returns ranked questions with title, score, answer count, accepted status, tags, ask and last-activity dates, and a short excerpt of the question body — not the full body. Results supply question_id values for stackexchange_get_th...

Parameters* required
acceptedOnlyboolean
When true, return only questions that have an accepted answer.
minScoreinteger
Minimum question score — excludes questions with lower scores. Setting minScore orders results by score (votes), which may differ from the requested sort.
pageinteger
Page of results to return, 1-based (default 1). Page 2 with pageSize 10 returns results 11–20. Each page is a separate upstream call and costs one API quota unit, which matters on the keyless 300/d...default: 1
pageSizeinteger
Number of results to return (1–30, default 10).default: 10
query*string
Full-text search query (e.g. "python async generator send value").
sitestring
Stack Exchange site to search — the api_site_parameter (e.g. "stackoverflow", "superuser", "serverfault") or the site's domain (e.g. "serverfault.com"). Defaults to "stackoverflow". Call stackexcha...default: stackoverflow
sortstring
Result ordering: "relevance" (default, best match), "votes" (highest score first), "activity" (most recently active), "newest" (most recently created).one of relevance · votes · activity · newestdefault: relevance
tagsarray
Filter results to questions with all specified tags.
stackexchange_get_tag_faqFetch the frequently asked questions for a tag on a Stack Exchange site — Stack Exchange's own "frequently asked" selection, returned in its order, not ranked by score; compare the scores yourself. Returns a question list without bodies; use stackexchange_get_thread to read th...4 params

Fetch the frequently asked questions for a tag on a Stack Exchange site — Stack Exchange's own "frequently asked" selection, returned in its order, not ranked by score; compare the scores yourself. Returns a question list without bodies; use stackexchange_get_thread to read th...

Parameters* required
pageinteger
Page of results to return, 1-based (default 1). Page 2 with pageSize 10 returns results 11–20. Each page is a separate upstream call and costs one API quota unit, which matters on the keyless 300/d...default: 1
pageSizeinteger
Number of results to return (1–30, default 10).default: 10
sitestring
Stack Exchange site — the api_site_parameter (e.g. "stackoverflow", "superuser") or the site's domain (e.g. "superuser.com"). Defaults to "stackoverflow". Call stackexchange_list_sites to discover...default: stackoverflow
tag*string
Tag to look up (e.g. "python", "javascript", "docker"). Must match exactly.
stackexchange_get_userFetch a Stack Exchange user profile by numeric user ID: reputation, badge counts, answer and question counts, account and last-access dates, and top tags by answer score. Useful for credibility context on an answer author — pass the authorUserId from any question or answer in...2 params

Fetch a Stack Exchange user profile by numeric user ID: reputation, badge counts, answer and question counts, account and last-access dates, and top tags by answer score. Useful for credibility context on an answer author — pass the authorUserId from any question or answer in...

Parameters* required
sitestring
Stack Exchange site the user ID belongs to — the api_site_parameter (e.g. "stackoverflow", "superuser") or the site's domain (e.g. "superuser.com"). User IDs are per-site, so pass the site of the t...default: stackoverflow
userId*integer
Numeric user ID (at most 2147483647) — use the authorUserId field from a question or answer in stackexchange_get_thread output.
stackexchange_get_threadFetch a complete Q&A thread — question body and all answers, accepted answer first then sorted by score, rendered as clean markdown with fenced code blocks. Accepts a full Stack Exchange question URL, which is read from the site its host names (e.g. "https://unix.stackexchange...4 params

Fetch a complete Q&A thread — question body and all answers, accepted answer first then sorted by score, rendered as clean markdown with fenced code blocks. Accepts a full Stack Exchange question URL, which is read from the site its host names (e.g. "https://unix.stackexchange...

Parameters* required
includeCommentsboolean
Fetch the comment thread under the question and under every returned answer (default false). Comments are where a stale answer usually gets corrected ("this breaks on v3", "use X instead now"), so...default: false
maxAnswersinteger
Maximum number of answers to include (1–100, default 10). Answers are sorted: accepted first, then by score.default: 10
questionIdOrUrl*string
Numeric question ID (e.g. "11227809") or a full Stack Exchange question URL (e.g. "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster"). A URL carries its own site...
sitestring
Stack Exchange site a numeric question ID belongs to — the api_site_parameter (e.g. "stackoverflow", "unix") or the site's domain (e.g. "unix.stackexchange.com"). Defaults to "stackoverflow". Not n...

Sponsors

Configuration

STACKEXCHANGE_API_KEY

Stack Exchange API key — lifts per-IP quota from ~300/day to ~10,000/day.

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

@cyanheads/stackexchange-mcp-server

Search Stack Exchange questions, fetch complete Q&A threads as clean markdown, browse tag FAQs, and look up user profiles via MCP. STDIO or Streamable HTTP.

5 Tools

Details

Repository
github.com/cyanheads/stackexchange-mcp-server
Categories
Documents & Knowledge, Search & Web Crawling
Package
@cyanheads/stackexchange-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
1
Tools verified
Nov 6, 2026

More from cyanheads

Related Documents & Knowledge MCP servers

View all
1hevangel avatarBatch Reviewhevangel/batch-review-mcpGit diff and markdown review with a web UI plus MCP stdio for AI agents.2stars
2cg3-llc avatarPriorcg3-llc/prior_mcpShared knowledge base for AI agents. Search and contribute solutions to technical problems.2stars
3aantenore avatarLorebaseaantenore/lorebaseRead and change a governed, versioned knowledge graph on Postgres through typed tools.2stars
4mit9 avatarComfyUI Buildermit9/mcp-comfy-ui-builderComfyUI MCP server: knowledge base, workflow builder, real-time execution, models, plugins.2stars
5pintomatic avatarKernal Mcppintomatic/kernalGraph-native memory for AI agents: a knowledge graph built from conversation, via MCP.2stars
6sprintra-io avatarSprintrasprintra-io/sprintra-mcpThe project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.2stars