Skip to main content
Glama
jamesjohnsdev

Code Research MCP Server

代码研究 MCP 服务器

铁匠徽章

模型上下文协议 (MCP) 服务器提供跨多个平台搜索和访问编程资源的工具。该服务器与主流开发者平台集成,帮助法学硕士 (LLM) 找到相关的代码示例、文档和软件包。

特征

集成平台

  • Stack Overflow - 编程问答

  • MDN Web Docs - Web 开发文档

  • GitHub - 代码和存储库搜索

  • npm——JavaScript 包注册中心

  • PyPI——Python 包索引

工具

search_stackoverflow

在 Stack Overflow 上搜索编程问题和答案。

  • 参数:

    • query (必需):搜索查询字符串

    • limit (可选):最大结果数(1-10,默认值:5)

  • 返回:带有分数、答案计数和摘录的格式化问题列表

  • 结果缓存 1 小时

search_mdn

在 MDN Web Docs 中搜索 Web 开发文档。

  • 参数:

    • query (必需):搜索查询字符串

  • 返回:前 5 个 MDN 文档匹配,包含摘要和链接

  • 结果缓存 1 小时

search_github

在 GitHub 上搜索存储库和代码示例。

  • 参数:

    • query (必需):搜索查询字符串

    • language (可选):按编程语言过滤

    • limit (可选):每个类别的最大结果数(1-10,默认值:5)

  • 返回:两部分:

    1. 按星号排序的顶级存储库

    2. 具有存储库上下文的相关代码文件

  • 结果缓存 1 小时

search_npm

在 npm 注册表中搜索 JavaScript 包。

  • 参数:

    • query (必需):搜索查询字符串

    • limit (可选):最大结果数(1-10,默认值:5)

  • 返回:软件包信息,包括版本、描述和下载统计信息

  • 结果缓存 1 小时

search_pypi

在 PyPI 中搜索 Python 包。

  • 参数:

    • query (必需):搜索查询字符串

  • 返回:详细的包信息,包括版本、作者和链接

  • 结果缓存 1 小时

search_all

同时搜索所有平台以获得全面的结果。

  • 参数:

    • query (必需):搜索查询字符串

    • limit (可选):每个平台的最大结果数(1-5,默认值:3)

  • 返回:所有平台的综合结果:

    1. Stack Overflow 问题和答案

    2. MDN 文档

    3. GitHub 存储库和代码

    4. npm 包

    5. PyPI 软件包

  • 结果缓存 1 小时

  • 注意:并行执行所有搜索以获得更快的响应

Related MCP server: Context7 MCP Clone

要求

  • Node.js >= 20.11.0

  • npm >= 10.0.0

  • 可选:GitHub 个人访问令牌,用于更高的 API 速率限制

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Code Research Server:

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

手动安装

  1. 克隆存储库并安装依赖项:

git clone https://github.com/nahmanmate/code-research-mcp-server.git
cd code-research-server
npm install
  1. 构建服务器:

npm run build
  1. 配置 MCP 设置:

将服务器配置添加到您的 MCP 设置文件:

  • VSCode: ~/.vscode-server/data/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json

  • 克劳德桌面:

    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %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": []
    }
  }
}

注意:将/absolute/path/to替换为您克隆存储库的实际路径。

发展

以开发模式运行

对于发生更改时自动重建的开发:

npm run watch

错误处理

服务器实现了强大的错误处理:

  • 每个平台的 API 特定错误消息

  • GitHub API 的速率限制处理

  • 服务不可用时的优雅回退

  • 缓存响应以减少 API 负载

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。您可以使用 MCP Inspector 来详细监控请求/响应:

npm run inspector

检查员提供:

  • 实时请求/响应监控

  • 工具执行追踪

  • 错误堆栈跟踪

  • 性能指标

在浏览器中访问提供的 URL 以访问调试界面。

缓存

使用node-cache缓存结果:

  • 默认 TTL:1 小时

  • 每个查询/限制组合单独的缓存键

  • 特定于平台的缓存策略

  • 内存高效存储

贡献

  1. 分叉存储库

  2. 创建功能分支

  3. 提交你的更改

  4. 推送到分支

  5. 创建拉取请求

执照

AGPLv3

Available Tools

6 tools
search_allC

Search all platforms simultaneously

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
limitNoMaximum results per platform (1-5, default: 3)

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'simultaneously', hinting at parallel execution, but doesn't disclose critical behaviors like rate limits, authentication needs, error handling, or what 'all platforms' entails (e.g., which ones). For a search tool with no annotation coverage, this leaves significant gaps in understanding how it operates.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for its purpose, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of searching multiple platforms, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'platforms' are, how results are returned (e.g., aggregated, formatted), or any behavioral constraints. For a tool with 2 parameters and sibling alternatives, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear documentation for 'query' and 'limit' parameters. The description adds no additional meaning beyond the schema, such as query syntax examples or platform-specific nuances. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search all platforms simultaneously' states the action (search) and scope (all platforms), but it's vague about what 'platforms' refers to. It doesn't specify the verb's target (e.g., 'code repositories', 'documentation') or distinguish from siblings like search_github which target specific platforms. The purpose is understandable but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling tools (search_github, search_mdn, etc.). The description implies it searches across multiple platforms, but it doesn't specify if this is for broad queries, cross-platform needs, or as an alternative to individual platform searches. Without explicit when/when-not instructions, the agent must infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_githubC

Search GitHub for repositories and code

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
languageNoFilter by programming language
limitNoMaximum number of results per category (default: 5)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool searches GitHub but doesn't describe what the search returns (e.g., repository metadata, code snippets, or both), any rate limits, authentication needs, or error handling. For a search tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence ('Search GitHub for repositories and code'), front-loaded with the core purpose. There is zero wasted text, making it efficient and easy to parse, though this conciseness comes at the cost of missing contextual details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (searching a major platform with 3 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain what the search returns, how results are structured, or any limitations, leaving the agent with insufficient context to use the tool effectively beyond basic parameter input.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond what the input schema provides, which has 100% coverage with clear descriptions for query, language, and limit. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional context like query syntax examples or language filtering details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search GitHub') and the target resources ('repositories and code'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings (like search_npm or search_pypi) beyond specifying the GitHub platform, missing an opportunity to highlight GitHub-specific search capabilities versus other code search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tools (search_all, search_mdn, search_npm, search_pypi, search_stackoverflow). It doesn't mention alternatives, prerequisites, or specific contexts where GitHub search is preferred over other search tools, leaving the agent to infer usage based on the platform name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_mdnC

Search MDN Web Docs for web development documentation

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool searches MDN Web Docs but doesn't describe what the search returns (e.g., articles, code snippets), how results are formatted, any rate limits, authentication needs, or error handling. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently communicates the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what kind of results to expect (e.g., links, summaries), how many results are returned, or any behavioral nuances. This leaves the agent with insufficient context to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'query' documented as 'Search query'. The description doesn't add any additional meaning beyond this, such as query syntax examples or search scope details. Given the high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search') and target resource ('MDN Web Docs for web development documentation'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling tools (search_all, search_github, etc.) beyond specifying the MDN source, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling alternatives. There's no mention of specific use cases for MDN documentation over other sources like GitHub or Stack Overflow, nor any prerequisites or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_npmC

Search npm registry for JavaScript packages

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
limitNoMaximum number of results (default: 5)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, what authentication might be required, rate limits, network behavior, or what format results will be returned in. For a search tool with zero annotation coverage, this represents a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just one sentence with zero wasted words. It's front-loaded with the core purpose and contains no unnecessary information. Every word earns its place in this minimal but complete statement of function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what information will be returned, how results are structured, whether there's pagination, or any behavioral characteristics. The agent would need to guess about the tool's operation and output format based solely on this brief description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond what's already in the schema, which has 100% coverage with clear descriptions for both 'query' and 'limit' parameters. Since the schema does the heavy lifting, the baseline score of 3 is appropriate - the description doesn't add value but doesn't need to compensate for schema deficiencies either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: searching the npm registry for JavaScript packages. It specifies both the action ('search') and the target resource ('npm registry for JavaScript packages'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like search_pypi or search_github, which is why it doesn't earn a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like search_pypi, search_github, and search_all available, there's no indication of when npm-specific searching is appropriate or when other search tools might be better suited. This lack of comparative context leaves the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_pypiB

Search PyPI for Python packages

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Search' implies a read-only operation, it doesn't specify whether this requires authentication, rate limits, pagination behavior, or what the response format looks like. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does without any unnecessary words. It's appropriately sized and front-loaded with the core functionality, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is minimally adequate but lacks important context. It doesn't explain what the search returns (packages, versions, metadata), how results are formatted, or any limitations. While the schema covers the parameter, the absence of output information and behavioral details makes this incomplete for optimal agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single 'query' parameter documented as 'Search query.' The description doesn't add any additional meaning about parameter usage, syntax, or examples beyond what the schema provides. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search') and target resource ('PyPI for Python packages'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling search tools (search_github, search_npm, etc.) beyond specifying the PyPI platform, which is why it doesn't reach a perfect score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like search_all, search_github, or search_npm. It doesn't mention any specific contexts, prerequisites, or exclusions for using this PyPI-specific search tool, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_stackoverflowC

Search Stack Overflow for programming questions and answers

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
limitNoMaximum number of results (default: 5)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the basic function but doesn't reveal important traits like whether this is a read-only operation, rate limits, authentication requirements, pagination behavior, or what format results return. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core function without unnecessary words. It's appropriately sized for a simple search tool and front-loads the essential information, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description should provide more context about behavioral aspects and result format. While the purpose is clear, important details like whether this is a safe read operation, what the results look like, or any limitations are missing, making it incomplete for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (query and limit). The description doesn't add any parameter-specific information beyond what's in the schema, such as query syntax examples or result format details. The baseline score of 3 reflects adequate but minimal value addition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search') and target resource ('Stack Overflow for programming questions and answers'), making the purpose immediately understandable. However, it doesn't specifically differentiate from sibling tools like search_all or search_github, which likely search different platforms for similar content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like search_all (which might include Stack Overflow) or other platform-specific search tools. There's no mention of use cases, prerequisites, or exclusions that would help an agent choose appropriately among the available search options.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updates
    • First observedsearch_all
    • First observedsearch_github
    • First observedsearch_mdn
    • First observedsearch_npm
    • First observedsearch_pypi
    • First observedsearch_stackoverflow

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose targeting a specific platform or resource, with no overlap in functionality. The descriptions explicitly differentiate the search targets (e.g., GitHub repositories, MDN documentation, npm packages), making it easy for an agent to select the appropriate tool without confusion.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'search_' as the prefix, followed by the platform name (e.g., search_github, search_mdn). This predictable naming scheme enhances readability and agent usability, with no deviations or mixed conventions.

Tool Count5/5

With 6 tools, the server is well-scoped for its purpose of code research across multiple platforms. Each tool earns its place by covering a distinct and relevant source (e.g., GitHub, MDN, npm, PyPI, Stack Overflow), avoiding both thinness and bloat for this domain.

Completeness5/5

The tool surface is complete for the server's stated purpose of code research, covering major platforms developers commonly use (GitHub, MDN, npm, PyPI, Stack Overflow) and including a unified search_all tool. There are no obvious gaps in coverage that would cause agent failures for typical research tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides up-to-date, version-specific documentation and code examples for software libraries directly to LLMs, enabling resolution of library identifiers and retrieval of relevant documentation with code snippets.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides LLMs with tools to search Stack Overflow for programming solutions, helping ground responses in real-world code examples.
    -