code research mcp server
Facilitates searching and accessing programming resources across platforms like Stack Overflow, MDN, GitHub, npm, and PyPI, aiding LLMs in finding code examples and documentation.
Facilitates searching and accessing programming resources across platforms like Stack Overflow, MDN, GitHub, npm, and PyPI, aiding LLMs in finding code examples and documentation.
A Model Context Protocol server that provides tools for searching and accessing programming resources across multiple platforms. This server integrates with popular developer platforms to help LLMs find relevant code examples, documentation, and packages.
search_stackoverflow
Search Stack Overflow for programming questions and answers.
- Parameters:
- query
(required): Search query string
- limit
(optional): Maximum results (1-10, default: 5)
- Returns: Formatted list of questions with scores, answer counts, and excerpts
- Results are cached for 1 hour
search_mdn
Search MDN Web Docs for web development documentation.
- Parameters:
- query
(required): Search query string
- Returns: Top 5 MDN documentation matches with summaries and links
- Results are cached for 1 hour
search_github
Search GitHub for both repositories and code examples.
- Parameters:
- query
(required): Search query string
- language
(optional): Filter by programming language
- limit
(optional): Maximum results per category (1-10, default: 5)
- Returns: Two sections:
1. Top repositories sorted by stars
2. Relevant code files with repository context
- Results are cached for 1 hour
search_npm
Search npm registry for JavaScript packages.
- Parameters:
- query
(required): Search query string
- limit
(optional): Maximum results (1-10, default: 5)
- Returns: Package information including version, description, and download stats
- Results are cached for 1 hour
search_pypi
Search PyPI for Python packages.
- Parameters:
- query
(required): Search query string
- Returns: Detailed package information including version, author, and links
- Results are cached for 1 hour
search_all
Search all platforms simultaneously for comprehensive results.
- Parameters:
- query
(required): Search query string
- limit
(optional): Maximum results per platform (1-5, default: 3)
- Returns: Combined results from all platforms:
1. Stack Overflow questions and answers
2. MDN documentation
3. GitHub repositories and code
4. npm packages
5. PyPI packages
- Results are cached for 1 hour
- Note: Executes all searches in parallel for faster response
To install Code Research Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @nahmanmate/code-research-mcp-server --client claude
Clone the repository and install dependencies:
git clone https://github.com/nahmanmate/code-research-mcp-server.git
cd code-research-server
npm install
Build the server:
npm run build
Configure MCP Settings:
Add the server configuration to your MCP settings file:
~/.vscode-server/data/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"code-research": {
"command": "node",
"args": ["/absolute/path/to/code-research-mcp-server/build/index.js"],
"env": {
"GITHUB_TOKEN": "your_github_token" // Optional: Prevents rate limiting
},
"disabled": false,
"alwaysAllow": []
}
}
}
Note: Replace /absolute/path/to
with the actual path where you cloned the repository.
For development with auto-rebuild on changes:
npm run watch
The server implements robust error handling: - API-specific error messages for each platform - Rate limit handling for GitHub API - Graceful fallbacks for service unavailability - Cached responses to reduce API load
Since MCP servers communicate over stdio, debugging can be challenging. Use the MCP Inspector for detailed request/response monitoring:
npm run inspector
The Inspector provides: - Real-time request/response monitoring - Tool execution tracing - Error stack traces - Performance metrics
Visit the provided URL in your browser to access the debugging interface.
Results are cached using node-cache
:
- Default TTL: 1 hour
- Separate cache keys per query/limit combination
- Platform-specific caching strategies
- Memory-efficient storage
AGPLv3
[
{
"description": "Search Stack Overflow for programming questions and answers",
"inputSchema": {
"properties": {
"limit": {
"description": "Maximum number of results (default: 5)",
"maximum": 10,
"minimum": 1,
"type": "number"
},
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_stackoverflow"
},
{
"description": "Search MDN Web Docs for web development documentation",
"inputSchema": {
"properties": {
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_mdn"
},
{
"description": "Search GitHub for repositories and code",
"inputSchema": {
"properties": {
"language": {
"description": "Filter by programming language",
"type": "string"
},
"limit": {
"description": "Maximum number of results per category (default: 5)",
"maximum": 10,
"minimum": 1,
"type": "number"
},
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_github"
},
{
"description": "Search npm registry for JavaScript packages",
"inputSchema": {
"properties": {
"limit": {
"description": "Maximum number of results (default: 5)",
"maximum": 10,
"minimum": 1,
"type": "number"
},
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_npm"
},
{
"description": "Search PyPI for Python packages",
"inputSchema": {
"properties": {
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_pypi"
},
{
"description": "Search all platforms simultaneously",
"inputSchema": {
"properties": {
"limit": {
"description": "Maximum results per platform (1-5, default: 3)",
"maximum": 5,
"minimum": 1,
"type": "number"
},
"query": {
"description": "Search query",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "search_all"
}
]