返回市场
检索增强思维

检索增强思维

作者:stat-guy16 星标更新:2025-08-13

项目介绍

RAT MCP Server (Node.js)

检索增强型思考MCP服务器 - 一个处理结构化思维并具有度量、分支和修订功能的推理工具。

安装

简单三步过程

git clone https://github.com/stat-guy/retrieval-augmented-thinking.git
cd retrieval-augmented-thinking
npm install -g .

验证安装

测试安装是否成功:

npx mcp-server-rat-node --help

成功指示器: 如果您看到 RAT MCP Server (Node.js) running on stdio,则您的安装已完成!

Claude Desktop配置

添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "retrieval-augmented-thinking": {
      "command": "npx",
      "args": ["mcp-server-rat-node"]
    }
  }
}

添加配置后,请重启Claude Desktop以加载RAT服务器。

使用

该服务器提供了一个用于处理结构化思维的单一rat工具:

// 基本用法
{
  "thought": "我需要逐步分析这个问题...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 1,
  "totalThoughts": 3
}

// 包含修订
{
  "thought": "让我重新考虑之前的分析...",
  "nextThoughtNeeded": false,
  "thoughtNumber": 2,
  "totalThoughts": 3,
  "isRevision": true,
  "revisesThought": 1
}

// 包含分支
{
  "thought": "替代方法:如果我们考虑一下...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 2,
  "totalThoughts": 4,
  "branchFromThought": 1,
  "branchId": "alt-path-1"
}

工具参数

必需

  • thought (字符串):要处理的思想内容
  • nextThoughtNeeded (布尔值):是否需要另一个思想来继续
  • thoughtNumber (整数):序列中的当前思想编号
  • totalThoughts (整数):预期的总思想数量(可调整)

可选

  • isRevision (布尔值):这是否修订了之前的思想
  • revisesThought (整数):正在修订的思想编号
  • branchFromThought (整数):分支的思想编号
  • branchId (字符串):此分支的唯一标识符
  • needsMoreThoughts (布尔值):如果需要,可以超过totalThoughts

响应格式

{
  "thought_number": 1,
  "total_thoughts": 3,
  "metrics": {
    "complexity": 0.342,
    "depth":  0.521,
    "quality": 0.643,
    "impact": 0.289,
    "confidence": 0.758
  },
  "analytics": {
    "total_thoughts": 5,
    "average_quality": 0.612,
    "chain_effectiveness": 0.145
  },
  "next_thought_needed": true,
  "visual_output": "┌─ 💭 思想 1/3 ─────────────────┐\\n│ 分析显示清晰模式... │\\n├─ 指标 ──────────────────────┤\\n│ 质量: 0.64 | 影响: 0.29... │\\n└─────────────────────────────────┘"
}

故障排除

如果安装失败

安装过程包括自动权限修复。如果您遇到问题:

  1. 确保已安装Node.js和npm
  2. 尝试使用替代安装方法:
    npm install -g git+https://github.com/stat-guy/retrieval-augmented-thinking.git
    
  3. 对于罕见的权限问题:
    chmod +x $(npm bin -g)/mcp-server-rat-node
    

验证步骤

在配置Claude Desktop之前,请始终验证:

npx mcp-server-rat-node --help

如果这显示 "RAT MCP Server (Node.js) running on stdio",则您可以配置Claude Desktop。

测试

运行测试套件:

npm test

测试工具执行:

node test-tool.js

许可证

此MCP服务器根据MIT许可证发布。这意味着您可以自由地使用、修改和分发软件,但须遵守MIT许可证的条款和条件。如需更多详情,请参阅项目存储库中的LICENSE文件。