@cyanheads/stackexchange-mcp-server

v0.1.4 pre-1.0

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.

@cyanheads/stackexchange-mcp-server
claude mcp add --transport http stackexchange-mcp-server https://stackexchange.caseyjhand.com/mcp
codex mcp add stackexchange-mcp-server --url https://stackexchange.caseyjhand.com/mcp
{
  "mcpServers": {
    "stackexchange-mcp-server": {
      "url": "https://stackexchange.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http stackexchange-mcp-server https://stackexchange.caseyjhand.com/mcp
{
  "mcpServers": {
    "stackexchange-mcp-server": {
      "command": "bunx",
      "args": [
        "@cyanheads/stackexchange-mcp-server@latest"
      ]
    }
  }
}
{
  "mcpServers": {
    "stackexchange-mcp-server": {
      "type": "http",
      "url": "https://stackexchange.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://stackexchange.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

5

stackexchange_list_sites

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 name. Use this tool to discover valid site parameters before calling other stackexchange_* tools.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stackexchange_list_sites",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "filter": {
      "description": "Optional case-insensitive name filter — returns only sites whose name contains all provided tokens. Omit to return all sites.",
      "type": "string"
    }
  },
  "additionalProperties": false
}
view source ↗

stackexchange_search_questions

open-world

Search questions across a Stack Exchange site. Returns ranked questions with title, score, answer count, accepted status, tags, and excerpt — no bodies at this stage. Results supply question_id values for stackexchange_get_thread, which fetches the full question body and all answers. Use the `site` parameter to target a specific community (e.g. "stackoverflow", "superuser", "unix"); call stackexchange_list_sites to discover valid site values.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stackexchange_search_questions",
    "arguments": {
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Full-text search query (e.g. \"python async generator send value\")."
    },
    "site": {
      "default": "stackoverflow",
      "description": "Stack Exchange site to search — use the api_site_parameter value (e.g. \"stackoverflow\", \"superuser\", \"serverfault\"). Defaults to \"stackoverflow\". Call stackexchange_list_sites to discover valid values.",
      "type": "string"
    },
    "tags": {
      "description": "Filter results to questions with all specified tags.",
      "type": "array",
      "items": {
        "type": "string",
        "description": "A single tag to filter by (e.g. \"python\", \"async\")."
      }
    },
    "acceptedOnly": {
      "description": "When true, return only questions that have an accepted answer.",
      "type": "boolean"
    },
    "minScore": {
      "description": "Minimum question score — excludes questions with lower scores.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "sort": {
      "default": "relevance",
      "description": "Result ordering: \"relevance\" (default, best match), \"votes\" (highest score first), \"activity\" (most recently active), \"newest\" (most recently created).",
      "type": "string",
      "enum": [
        "relevance",
        "votes",
        "activity",
        "newest"
      ]
    },
    "pageSize": {
      "default": 10,
      "description": "Number of results to return (1–30, default 10).",
      "type": "integer",
      "minimum": 1,
      "maximum": 30
    }
  },
  "required": [
    "query",
    "site",
    "sort",
    "pageSize"
  ],
  "additionalProperties": false
}
view source ↗

stackexchange_get_tag_faq

open-world

Fetch the highest-voted answered questions for a tag on a Stack Exchange site — the canonical "best answers in X" list. Returns a question list without bodies; use stackexchange_get_thread to read the full body and answers for any result. Use this tool to find the authoritative community resources on a topic (e.g. tag "javascript" on stackoverflow). Use stackexchange_search_questions for free-text search rather than tag-based browsing.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stackexchange_get_tag_faq",
    "arguments": {
      "tag": "<tag>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "Tag to look up (e.g. \"python\", \"javascript\", \"docker\"). Must match exactly."
    },
    "site": {
      "default": "stackoverflow",
      "description": "Stack Exchange site — use the api_site_parameter value (e.g. \"stackoverflow\", \"superuser\"). Defaults to \"stackoverflow\". Call stackexchange_list_sites to discover valid values.",
      "type": "string"
    },
    "pageSize": {
      "default": 10,
      "description": "Number of results to return (1–30, default 10).",
      "type": "integer",
      "minimum": 1,
      "maximum": 30
    }
  },
  "required": [
    "tag",
    "site",
    "pageSize"
  ],
  "additionalProperties": false
}
view source ↗

stackexchange_get_user

open-world

Fetch a Stack Exchange user profile by numeric user ID: reputation, badge counts, top tags by answer score, and account metadata. Useful for credibility context on an answer author — pass the authorUserId from any question or answer in stackexchange_get_thread output. Returns profile fields plus up to 10 top tags by answer score.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stackexchange_get_user",
    "arguments": {
      "userId": "<userId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "userId": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Numeric user ID — use the authorUserId field from a question or answer in stackexchange_get_thread output."
    },
    "site": {
      "default": "stackoverflow",
      "description": "Stack Exchange site — use the api_site_parameter value (e.g. \"stackoverflow\", \"superuser\"). Defaults to \"stackoverflow\". Call stackexchange_list_sites to discover valid values.",
      "type": "string"
    }
  },
  "required": [
    "userId",
    "site"
  ],
  "additionalProperties": false
}
view source ↗

stackexchange_get_thread

open-world

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 an integer question ID or a full Stack Exchange question URL (e.g. "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster" or "11227809"). HTML is normalized to markdown automatically; attribution (author + link) included per CC BY-SA 4.0. Get question IDs from stackexchange_search_questions or stackexchange_get_tag_faq.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stackexchange_get_thread",
    "arguments": {
      "questionIdOrUrl": "<questionIdOrUrl>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "questionIdOrUrl": {
      "type": "string",
      "description": "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\"). The integer immediately following /questions/ is extracted from URLs."
    },
    "site": {
      "default": "stackoverflow",
      "description": "Stack Exchange site — use the api_site_parameter value (e.g. \"stackoverflow\", \"superuser\"). Defaults to \"stackoverflow\". Must match the site where the question lives. Call stackexchange_list_sites to discover valid values.",
      "type": "string"
    },
    "maxAnswers": {
      "default": 10,
      "description": "Maximum number of answers to include (1–100, default 10). Answers are sorted: accepted first, then by score.",
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    }
  },
  "required": [
    "questionIdOrUrl",
    "site",
    "maxAnswers"
  ],
  "additionalProperties": false
}
view source ↗