Back to MCP directory
publicPublicdnsLocal runtime

code-reasoning

Code Reasoning是一个MCP服务器工具,专门用于增强Claude解决复杂编程问题的能力,通过结构化、分步思考的方法分解编程任务,支持多路径探索和思维修正。

article

README

🚀 代码推理 MCP 服务器

代码推理 MCP 服务器是一个增强 Claude 解决复杂编程任务能力的模型上下文协议(MCP)服务器,它通过结构化的逐步思考来实现这一目标,能帮助 Claude 更好地应对复杂编程问题。

🚀 快速开始

代码推理是一个实用工具,它能帮助 Claude 将复杂的编程问题分解为可管理的步骤,运用顺序思考方法来处理问题。其具体功能包括:

  • 分步分析代码问题
  • 通过分支探索替代解决方案
  • 在需要时重新考虑或修正

📦 安装指南

本地安装

  1. 克隆仓库:
git clone https://github.com/your-repository.git
cd code-reasoning-mcp-server
  1. 安装依赖项:
npm install
  1. 启动服务器:
node src/server.ts

Docker 安装

  1. 拉取镜像:
docker pull your-image:tag
  1. 运行容器:
docker run -p 3000:3000 your-image:tag

💻 使用示例

基础用法

配置文件

config.json中进行如下配置:

{
  "port": 3000,
  "modelPath": "path/to/your/model",
  "apiKey": "your-api-key"
}

示例代码

const { CodeReasoningServer } = require('code-reasoning-mcp-server');
const server = new CodeReasoningServer();
server.start().then(() => {
    console.log('服务器已启动');
});

📚 详细文档

项目结构

以下是项目的目录结构:

src/
├── server.ts          # 主服务器文件
├── model.ts           # 模型实现
├── config.ts          # 配置管理
└── utils/             # 工具函数
    └── logger.ts      # 日志记录

测试框架

用例

import { CodeReasoningServer } from './src';
describe('代码推理服务器', () => {
    it('应正确处理请求', async () => {
        const server = new CodeReasoningServer();
        await expect(server.handleRequest({})).resolves.toBe(200);
    });
});

✨ 主要特性

功能特性

  1. 模型集成:支持多种 AI 模型。
  2. 灵活配置:可通过配置文件自定义参数。
  3. 高效处理:优化的代码结构确保快速响应。

技术优势

  • 基于成熟的 MCP 协议,确保兼容性和扩展性。
  • 使用现代 JavaScript 框架,保证代码简洁和性能优化。
  • 提供详细的日志和监控功能,便于调试和维护。

📄 许可证

该项目使用 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。

附录:测试结果概览

| 情景 | HYBRID_DESIGN | CODE_REASONING_0_30 | DEFAULT | SEQUENTIAL | |------------------------|--------------|--------------------|--------|------------| | 算法选择 | 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% |

附注

个人认为最大的改进是将以下内容添加到提示的末尾: "✍️ 每个想法结束时,请问:‘我遗漏了什么或需要重新考虑什么?’"

更多细节请参阅测试框架

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client