Code Reasoning MCP Server

Integrations

  • Allows installation from source via the GitHub repository, providing access to the complete codebase for advanced customization and development.

  • Enables installation and execution of the code reasoning MCP server through the npm package registry, with support for both global installation and direct execution via npx.

代码推理 MCP 服务器

模型上下文协议 (MCP) 服务器增强了 Claude 通过结构化、逐步的思维解决复杂编程任务的能力。

快速安装

  1. 通过编辑来配置 Claude Desktop:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
    { "mcpServers": { "code-reasoning": { "command": "npx", "args": ["-y", "@mettamatt/code-reasoning"] } } }
  2. 配置 VS Code:
{ "mcp": { "servers": { "code-reasoning": { "command": "npx", "args": ["-y", "@mettamatt/code-reasoning"] } } } }

用法

  1. 要触发此 MCP,请将其附加到您的聊天消息中:
    Use sequential thinking to reason about this.
  2. 使用触发代码推理的现成提示:

  • 点击Claude Desktop聊天窗口中的“+”图标,或者在Claude Code中输入/help查看具体命令。
  • 从可用工具中选择“从代码推理添加”
  • 选择提示模板并填写所需信息
  • 提交表单以将提示添加到您的聊天消息中并按回车键

有关使用提示模板的详细信息,请参阅提示指南

命令行选项

  • --debug :启用详细日志记录
  • --help-h :显示帮助信息

主要特点

  • 编程重点:针对编码任务和问题解决进行了优化
  • 结构化思维:将复杂问题分解为可管理的步骤
  • 思路分支:并行探索多种解决方案路径
  • 思想修正:随着理解的提高,完善先前的推理
  • 安全限制:20 个思考步骤后自动停止,以防止循环
  • 即用型提示:用于常见开发任务的预定义模板

文档

详细文档可在 docs 目录中找到:

项目结构

├── index.ts # Entry point ├── src/ # Implementation source files └── test/ # Testing framework

及时评估

代码推理 MCP 服务器包含一个提示评估系统,用于评估 Claude 遵循代码推理提示的能力。该系统允许:

  • 针对场景问题测试不同的提示变化
  • 验证参数格式是否合规
  • 解决方案质量评分

要使用提示评估系统,请运行:

npm run eval

提示比较和发展

我们投入了大量精力来开发代码推理服务器的最佳提示。当前实现使用的是 HYBRID_DESIGN 提示,该提示在我们的评估过程中脱颖而出,成为最终的赢家。

我们比较了四种不同的提示设计:

快速设计描述
顺序原始的顺序思维提示设计
默认先前在服务器中使用的基线提示
代码推理030专注于代码特定推理的实验变体
混合设计精致的设计融合了其他方法的最佳元素

我们对七种不同的编程场景的评估表明,HYBRID_DESIGN 的表现优于其他提示:

设想混合设计代码推理030默认顺序
算法选择87%82%88%82%
错误识别87%91%88%92%
多阶段实施83%67%79%82%
系统设计分析82%87%78%82%
代码调试任务92%87%92%92%
编译器优化83%78%67%73%
缓存策略86%88%82%87%
平均的86%83%82%84%

HYBRID_DESIGN 提示题略微展现出最高的平均解决方案质量(86%)以及在所有场景下最稳定的性能,没有低于 80% 的得分。它也产生了最多的想法。src src/server.ts文件已更新,以使用此最佳提示题设计。

就我个人而言,我认为最大的改进是在提示的末尾添加这句话:“✍️在每个想法的结尾问一句:‘我遗漏了什么或者需要重新考虑什么?’”

有关提示评估系统的更多详细信息,请参阅测试框架

执照

本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

针对编程任务进行了优化的增强型顺序思维工具,有助于将复杂的编码问题分解为具有分支和修订功能的结构化、自我审核的思维步骤。

  1. 快速安装
    1. 用法
      1. 命令行选项
        1. 主要特点
          1. 文档
            1. 项目结构
              1. 及时评估
                1. 提示比较和发展
              2. 执照

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  An adaptation of the MCP Sequential Thinking Server designed to guide tool usage in problem-solving. This server helps break down complex problems into manageable steps and provides recommendations for which MCP tools would be most effective at each stage.
                  Last updated -
                  1
                  363
                  128
                  TypeScript
                  MIT License
                • A
                  security
                  F
                  license
                  A
                  quality
                  An MCP server implementation that leverages Google's Gemini API to provide analytical problem-solving capabilities through sequential thinking steps without code generation.
                  Last updated -
                  1
                  14
                  JavaScript
                • -
                  security
                  A
                  license
                  -
                  quality
                  A research tool that performs comprehensive, in-depth research on complex topics by combining sequential thinking with Brave Search capabilities to provide detailed, well-sourced reports.
                  Last updated -
                  2
                  TypeScript
                  MIT License
                • -
                  security
                  -
                  license
                  -
                  quality
                  Provides a tool for dynamic and reflective problem-solving by breaking complex problems into manageable steps with support for revision, branching, and hypothesis generation.
                  Last updated -
                  13,824
                  JavaScript

                View all related MCP servers

                ID: wha708n6hz