
Stackexchange Mcp
io.github.YashLimbani由 GitHub 账号 YashLimbani 发布v0.1.0更新于 Nov 7, 2026
An MCP server that provides [describe what your server does]
概览
只读的 MCP 服务器,让助手搜索 Stack Overflow 及其他 Stack Exchange 站点,并读取问题及其最佳回答。
- 可以做什么
- 按主题、标签、站点、排序方式或仅接受回答筛选来搜索问题
- 读取单个问题及其最佳回答,优先显示已采纳回答
- 用粘贴的报错信息或堆栈跟踪搜索相关帖子,搜索前会去除路径、行号和地址
- 查询准确的标签名,并获取标签概览,包括问题数量和最高票问题
- 查看剩余 API 配额以及当前是否处于限流等待
- 以资源形式提供站点列表、搜索技巧和配额快照,并提供调试、方案对比和标签入门提示词
- 适用场景
- 当你希望调试帮助或技术解释基于真实且有投票的 Stack Overflow 回答而非模型猜测时适用,例如粘贴堆栈跟踪、比较两种方案,或了解一个不熟悉的技术标签。
- 运行要求
- 通过 stdio 在本地运行 PyPI 包 stackexchange-mcp,使用 uvx 启动,因此需要安装 uv。可选的 Stack Exchange API 密钥通过 STACKEXCHANGE_KEY 传入;不设置时匿名配额小得多。还可选配默认站点、缓存时长和正文最大长度。需要能访问 Stack Exchange API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Stackexchange Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
stackexchange-mcp
An MCP server that lets your AI assistant search Stack Overflow and other Stack Exchange sites, read questions with their best answers, and ground its debugging help in real, voted answers instead of guessing.
- Read-only: it never posts, votes or edits anything.
- Model-friendly output: short summaries, Markdown instead of HTML, code blocks preserved, long posts truncated with a link.
- Respects the API: optional API key, backoff handling, request spacing, retries, caching and quota tracking.
- Clear errors: every failure tells the model what happened and what to try next.
Not affiliated with Stack Exchange, Inc. Content returned by the API is licensed CC BY-SA (3.0 or 4.0 depending on the post). The server returns the author, link and license so assistants can attribute it.
What it provides
[project] name = "mcp-server" version = "0.1.0" requires-python = ">=3.12" dependencies = [ "httpx>=0.28.1", "mcp[cli]>=1.0,<2", "pydantic>=2.14.2", ]
[dependency-groups] dev = [ "pytest>=9.2.0", ]
Tools
Resources
Prompts
Quick start
1. Get a free API key (recommended)
The server works without a key, but the anonymous quota is small: the API reported 300 requests per day without a key and 10,000 with one. Register an app on Stack Apps to get a key; you do not need OAuth for read-only use.
2. Install
You need uv. The server runs straight from PyPI:
(That starts a stdio server and waits; you normally let your AI app launch it using one of the configs below.)
3. Connect your AI app
Use the full path to uvx if your app cannot find it (which uvx).
VS Code (GitHub Copilot, Agent mode) - .vscode/mcp.json:
Antigravity CLI - .agents/mcp_config.json in your project (or ~/.gemini/config/mcp_config.json globally):
Start agy and run /mcp to confirm it is connected.
Claude Code:
Claude Desktop (macOS/Windows) and Cursor - same JSON shape as Antigravity (mcpServers), in claude_desktop_config.json or ~/.cursor/mcp.json.
Keep your key out of files you commit.
Configuration
Rate limits and errors
- Identical requests within the cache window cost no quota.
- If the API sends a
backoffvalue, the server waits it out (up to 10 seconds) before the next call; longer waits are reported instead of blocking. - Requests are spaced at least 0.2 seconds apart.
- Timeouts, network errors and 5xx responses are retried twice with exponential delay (0.5 s, then 1 s).
- When the daily quota is exhausted the server stops calling the API until the next UTC day.
The API key is never written to logs or error messages.
Example prompts
You do not need to name a tool. Things that should make the assistant use this server:
- "What's the difference between
asyncio.sleepandtime.sleep? Check Stack Overflow." - "I get
AttributeError: 'NoneType' object has no attribute 'foo'- find help on Stack Overflow." (paste the traceback) - "Is there a Stack Overflow tag for testing async code with pytest?"
- "I'm new to python-asyncio. Give me an overview from Stack Overflow."
- "Find recent discussions about Docker networking on Server Fault."
Tested with
Results for each prompt are in TESTING.md.
- Antigravity CLI: connects and lists all 6 tools. In a 10-prompt run, the model picked the expected tool without being told its name in 9 of 10 prompts (one prompt still needs a re-run) and chose sensible arguments such as
site,sortandaccepted_only. It correctly used no tool for an unrelated question. - VS Code (Copilot Agent mode): the server starts and 6 tools are discovered; tool-call results are not recorded yet.
- MCP Inspector: connects and lists the server's tools (re-check all resources and prompts before release).
Troubleshooting
- Server "anonymous (low quota)" in the log: the key did not reach the server. Put
STACKEXCHANGE_KEYin theenvblock of your client's config. - Command not found: use the absolute path of
uvxin the config. - VS Code shows no tools: use a normal Copilot Agent mode chat session in a workspace that contains
.vscode/mcp.json; some session types keep their own separate server list. - The assistant never calls a tool: ask it explicitly once ("search Stack Overflow for ...") and check the tool list in your client.
- Logs: the server writes logs to stderr (never stdout, which carries the protocol). In VS Code, open the Output panel and choose the server.
Development
Tests need no network: the API is mocked using real saved responses in samples/. See DESIGN.md for the design and CONTRIBUTING.md for how to help.
License
MIT for the code (see LICENSE). Stack Exchange content is CC BY-SA; attribute the author and link when you reuse it.
来源:README.md,提交 b9bce4a
工具
0版本历史
1- v0.1.0最新Nov 7, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分