stack-exchange-mcp
@jagreetdg
Re-Stack MCP server is designed to integrate Stack Overflow into LLM-based coding workflows using the Stack Exchange API
Overview
What is stack-exchange-mcp?
stack-exchange-mcp is a Model Context Protocol (MCP) server that integrates Stack Overflow with LLM-based coding environments (Cursor, Windsurf, GPT, Claude, etc.) using the Stack Exchange API. It provides real-time access to Stack Overflow solutions and encourages developers to contribute new questions and answers, restoring the Stack Overflow feedback loop.
How to use stack-exchange-mcp?
Install Node.js 18+, register for a Stack Exchange API key and Stack Apps application. Clone the repository, install dependencies, configure the .env file with OAuth credentials, build the project, and start the server. The server exposes MCP tools for read and write operations on Stack Overflow.
Key features of stack-exchange-mcp
- Realβtime Stack Overflow access inside LLM coding workflows
- Read operations: search/fetch questions, answers, comments, tags, users
- Write operations: post questions, answers, comments (requires OAuth authentication)
- Encourages posting undocumented issues and contributing solutions back
- Built with TypeScript and uses the Stack Exchange API
Use cases of stack-exchange-mcp
- LLM assistants fetch the latest Stack Overflow answers to refine coding suggestions
- Developers post new questions directly from their AI environment
- Users contribute solutions to problems solved privately, enriching the knowledge base
- Browse and search Stack Overflow tags and user profiles
FAQ from stack-exchange-mcp
What does stack-exchange-mcp do?
It bridges Stack Overflow with LLM tools, giving AI coding assistants live access to Stack Overflow content and enabling users to post questions and answers through the same interface.
What are the prerequisites to use stack-exchange-mcp?
Node.js 18+ (ES2022), a Stack Exchange API key, and a registered Stack Apps application for write access.
Can I write to Stack Overflow using stack-exchange-mcp?
Yes, but write operations (posting questions, answers, comments, editing posts) require Stack Exchange OAuth 2.0 authentication. Read operations do not need authentication.
What read operations are available?
You can search and fetch questions, get answers for specific questions, fetch comments on posts, browse and search tags, and retrieve user information.
How is authentication handled?
The server uses Stack Exchange OAuth 2.0. You register an app on Stack Apps, configure OAuth credentials in the .env file, and the server handles the OAuth flow when write operations are requested.