Stack Over MCP
Provides LLMs with tools to search Stack Overflow for programming solutions, helping ground responses in real-world code examples.
README
Stack Over MCP
An MCP (Model Context Protocol) server that provides LLMs with tools to search Stack Overflow for programming solutions, helping ground responses in real-world code examples and reduce hallucinations.
Features
- Smart Search: Search Stack Overflow questions with customizable filters
- Detailed Question Analysis: Get complete question details with all answers
- Tag-Based Discovery: Find popular solutions by programming language/framework
- Real-time Results: Direct access to Stack Overflow's API
- Rich Metadata: Scores, view counts, acceptance status, and more
Installation
-
Clone and setup the project:
cd stack-over-mcp python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
Usage
Running the MCP Server
python main.py
The server will start and provide three main tools:
1. search_stackoverflow
Search Stack Overflow questions with flexible filtering:
# Basic search
search_stackoverflow("python list comprehension")
# Advanced search with filters
search_stackoverflow(
query="react hooks error",
limit=5,
sort="votes",
tags=["javascript", "react"],
accepted_only=True
)
Parameters:
query: Search termslimit: Max results (1-100, default: 10)sort: "relevance", "activity", "votes", or "creation"tags: Filter by programming tagsaccepted_only: Only questions with accepted answers
2. get_question_details
Get complete information about a specific question:
# Get question with all answers
get_question_details(question_id=12345678)
# Get just question metadata
get_question_details(question_id=12345678, include_answers=False)
3. search_by_tags
Find popular questions by technology tags:
# Find top Python questions
search_by_tags(tags=["python"], sort="votes", min_score=10)
# Find recent React + TypeScript questions
search_by_tags(
tags=["javascript", "react", "typescript"],
sort="activity",
limit=5
)
Integration with MCP Clients
This server is designed to work with MCP-compatible clients like Claude Desktop. Add it to your MCP configuration:
{
"mcpServers": {
"stack-over-mcp": {
"command": "python",
"args": ["path/to/stack-over-mcp/main.py"]
}
}
}
Use Cases
- Debugging: Find solutions to specific error messages
- Learning: Discover best practices and common patterns
- Code Review: Validate approaches against community solutions
- Architecture: Find proven solutions for complex problems
- API Usage: Get real examples of library/framework usage
API Rate Limits
The Stack Overflow API has rate limits:
- Unauthenticated: 300 requests per day per IP
- Authenticated: 10,000 requests per day (requires API key)
For production use, consider implementing API key authentication in stack_api.py.
Project Structure
stack-over-mcp/
├── main.py # FastMCP server with tool definitions
├── stack_api.py # Stack Overflow API client
├── requirements.txt # Python dependencies
└── README.md # This file
Contributing
Feel free to enhance the server with additional features:
- API key authentication for higher rate limits
- Caching for frequently requested questions
- Advanced filtering options
- Support for other Stack Exchange sites
License
This project is open source and available under the MIT License.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。