检索增强思维服务器

一个处理结构化思维的工具,具有度量、分支和修订功能,适用于需要逐步分析和调整思维流程的场景。

  • by stat-guy
  • JavaScript
  • 本地部署
  • 24 星标
  • 更新于
在 GitHub 查看 stat-guy/retrieval-augmented-thinking

使用说明

RAT MCP服务器(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桌面配置

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

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

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

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

用法

服务器提供单一 rat 处理结构化思维的工具:

// Basic usage
{
  "thought": "I need to analyze this problem step by step...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 1,
  "totalThoughts": 3
}

// With revision
{
  "thought": "Let me reconsider my previous analysis...",
  "nextThoughtNeeded": false,
  "thoughtNumber": 2,
  "totalThoughts": 3,
  "isRevision": true,
  "revisesThought": 1
}

// With branching
{
  "thought": "Alternative approach: what if we consider...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 2,
  "totalThoughts": 4,
  "branchFromThought": 1,
  "branchId": "alt-path-1"
}

刀具参数

必需

  • thought (string):要处理的思想内容
  • nextThoughtNeeded (boolean):是否需要另一个想法才能继续
  • thoughtNumber (整数):序列中的当前思想数
  • totalThoughts (整数):总预期想法(可调)

可选的

  • isRevision (boolean):这是否改变了之前的想法
  • revisesThought (整数):正在修改的思想数
  • branchFromThought (整数):要分支的思想数
  • branchId (string):此分支的唯一标识符
  • needsMoreThoughts (boolean):如果需要,可以超越总体思维

响应格式

{
  "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": "┌─ 💭 Thought 1/3 ─────────────────┐\\n│ Analysis shows clear patterns... │\\n├─ Metrics ──────────────────────┤\\n│ Quality: 0.64 | Impact: 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服务器(Node.js)在stdio上运行”,则您已准备好配置Claude Desktop。

测试

运行测试套件:

npm test

测试工具执行:

node test-tool.js

许可证

此MCP服务器根据MIT许可证获得许可。这意味着您可以根据MIT许可证的条款和条件自由使用、修改和分发软件。有关更多详细信息,请参阅项目存储库中的LICENSE文件。