MCP HubMCP Hub
nahmanmate

code-research-mcp-server

by: nahmanmate

code research mcp server

30created 27/01/2025
Visit
research
code

📌Overview

Purpose: To provide a comprehensive server solution for searching and accessing programming resources across various platforms, enhancing LLMs' ability to find relevant code examples, documentation, and packages.

Overview: The Code Research MCP Server is designed to integrate seamlessly with popular developer platforms such as Stack Overflow, MDN Web Docs, GitHub, npm, and PyPI. It acts as a central hub for retrieving diverse programming resources, allowing users to perform searches across multiple sources efficiently.

Key Features:

  • Integrated Platforms: Connects directly with major resources like Stack Overflow for Q&A, MDN for documentation, GitHub for code and repositories, npm for JavaScript packages, and PyPI for Python packages.

  • Comprehensive Search Tools: Provides various search functions including search_stackoverflow, search_mdn, search_github, search_npm, search_pypi, and search_all, enabling users to find detailed programming information quickly across all platforms, with results cached for improved response times.


Code Research MCP Server

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.

Features

Integrated Platforms

  • Stack Overflow: Programming Q&A
  • MDN Web Docs: Web development documentation
  • GitHub: Code and repository search
  • npm: JavaScript package registry
  • PyPI: Python package index

Tools

search_stackoverflow

  • 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.
  • Cache: Results are cached for 1 hour.

search_mdn

  • Parameters:
    • query (required): Search query string
  • Returns: Top 5 MDN documentation matches with summaries and links.
  • Cache: Results are cached for 1 hour.

search_github

  • 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: top repositories sorted by stars and relevant code files with repository context.
  • Cache: Results are cached for 1 hour.

search_npm

  • Parameters:
    • query (required): Search query string
    • limit (optional): Maximum results (1-10, default: 5)
  • Returns: Package information including version, description, and download stats.
  • Cache: Results are cached for 1 hour.

search_pypi

  • Parameters:
    • query (required): Search query string
  • Returns: Detailed package information including version, author, and links.
  • Cache: Results are cached for 1 hour.

search_all

  • Parameters:
    • query (required): Search query string
    • limit (optional): Maximum results per platform (1-5, default: 3)
  • Returns: Combined results from all platforms.
  • Cache: Results are cached for 1 hour, executed in parallel for faster response.

Requirements

  • Node.js >= 20.11.0
  • npm >= 10.0.0
  • Optional: GitHub personal access token for higher API rate limits.

Installation

Installing via Smithery

To install Code Research Server automatically via Smithery:

npx -y @smithery/cli install @nahmanmate/code-research-mcp-server --client claude

Manual Installation

  1. Clone the repository and install dependencies:
    git clone https://github.com/nahmanmate/code-research-mcp-server.git
    cd code-research-server
    npm install
    
  2. Build the server:
    npm run build
    
  3. Configure MCP Settings: Add the server configuration to your MCP settings file as shown below:
{
  "mcpServers": {
    "code-research": {
      "command": "node",
      "args": ["/absolute/path/to/code-research-mcp-server/build/index.js"],
      "env": {
        "GITHUB_TOKEN": "your_github_token"  // Optional
      },
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

Development

Running in Development Mode

For development with auto-rebuild on changes:

npm run watch

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

Debugging

Use the MCP Inspector for detailed request/response monitoring:

npm run inspector

Caching

Results are cached using node-cache:

  • Default TTL: 1 hour
  • Separate cache keys per query/limit combination

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

AGPLv3