Think Tool MCP Server 使用说明
项目简介
Think Tool Server 是一个 MCP (Model Context Protocol) 服务器的实现,它基于 Anthropic 提出的 "think" 工具概念构建,旨在为 Claude 等大型语言模型 (LLM) 提供结构化的思考空间,从而显著提升 LLM 在复杂任务中的推理能力。该服务器通过实现一个简单的 "think" 工具,允许 LLM 在生成回复的过程中暂停并进行结构化思考,类似于提供一个思考的草稿纸,帮助 LLM 更有效地组织思路、分析问题和制定策略。
主要功能点
- 实现 "think" 工具: 提供一个名为 "think" 的 MCP 工具,LLM 可以调用该工具来记录和组织思考过程。
- 结构化思考: 通过 "think" 工具,LLM 可以在复杂推理或需要缓存记忆的场景下,进行结构化的思考,提升问题解决的准确性和可靠性。
- 提升 LLM 推理能力: 实验证明,"think" 工具能够显著提升 LLM 在复杂任务中的表现,例如复杂客服任务、政策合规性检查、软件工程基准测试等。
- 易于集成: 可以通过简单的配置集成到 Claude Desktop 和 Cursor 等支持 MCP 协议的客户端。
- 标准 MCP 服务器: 遵循 MCP 协议规范,易于扩展和与其他 MCP 工具集成。
安装步骤
- 克隆仓库:
git clone https://github.com/PhillipRt/think-mcp-server.git cd think-mcp-server - 安装依赖:
npm install - 构建项目:
npm run build - 启动服务器:
启动成功后,终端会输出 'Think Tool Server is running...'npm start
服务器配置
要将 Think Tool Server 集成到 MCP 客户端(例如 Claude Desktop),您需要配置客户端以连接到该服务器。以下是 Claude Desktop 客户端的配置示例,您需要将以下 JSON 配置添加到 Claude Desktop 的配置文件 'claude_desktop_config.json' 中。
Claude Desktop 配置示例 (claude_desktop_config.json):
{ "mcpServers": { "think-tool": { // 服务器名称,可以自定义 "command": "node", // 启动服务器的命令,这里使用 node "args": ["path/to/think-mcp-server/dist/server.js"] // 启动服务器命令的参数,指向编译后的 server.js 文件路径,请替换为实际路径 } } }
配置说明:
- '"think-tool"': 是您为该 MCP 服务器定义的名称,在客户端中用于标识和引用该服务器。您可以自定义此名称。
- '"command": "node"': 指定了运行服务器的命令。由于该服务器是 Node.js 应用,因此这里使用 'node' 命令。
- '"args": ["path/to/think-mcp-server/dist/server.js"]': 指定了传递给 'node' 命令的参数。这个参数是一个数组,包含了服务器主程序 'server.js' 的路径。 请务必将 '"path/to/think-mcp-server/dist/server.js"' 替换为您实际的 'server.js' 文件路径。 该路径是相对于 Claude Desktop 客户端的,或者是绝对路径。如果您不确定,可以使用绝对路径,例如 '/Users/your_username/think-mcp-server/dist/server.js' (macOS) 或 'C:\Users\YourUsername\think-mcp-server\dist\server.js' (Windows)。
Cursor 客户端配置:
Cursor 客户端的配置方式类似,您需要在 Cursor 的设置中找到 "Rules for AI" 或类似的 MCP 服务器配置选项,并添加相应的服务器配置。具体的配置界面和操作方式请参考 Cursor 客户端的文档。
基本使用方法
成功配置并启动 Think Tool Server 后,您需要在与 Claude 或 Cursor 等 LLM 交互时,通过 系统提示 (System Prompt) 或 规则 (Rules) 的方式,引导 LLM 在合适的时机调用 "think" 工具。
核心思想是告诉 LLM 在复杂任务或需要结构化思考时,先使用 "think" 工具进行思考和规划,然后再进行后续操作或回复用户。
仓库的 'README.md' 文件中提供了针对 Claude Desktop (Custom Instructions) 和 Cursor (Global Rules) 的优化系统提示示例,您可以直接复制并添加到您的客户端配置中,以获得最佳的使用效果。
例如,对于 Claude Desktop,您可以添加以下系统提示到自定义指令中:
You have access to a "think" tool that provides a dedicated space for structured reasoning. Using this tool significantly improves your performance on complex tasks. ## When to use the think tool Before taking any action or responding to the user after receiving tool results, use the think tool as a scratchpad to: - List the specific rules that apply to the current request - Check if all required information is collected - Verify that the planned action complies with all policies - Iterate over tool results for correctness - Analyze complex information from web searches or other tools - Plan multi-step approaches before executing them ## How to use the think tool effectively When using the think tool: 1. Break down complex problems into clearly defined steps 2. Identify key facts, constraints, and requirements 3. Check for gaps in information and plan how to fill them 4. Evaluate multiple approaches before choosing one 5. Verify your reasoning for logical errors or biases Remember that using the think tool has been shown to improve your performance by up to 54% on complex tasks, especially when working with multiple tools or following detailed policies.
通过以上配置和系统提示,您就可以在支持 MCP 协议的 LLM 客户端中使用 Think Tool Server 提供的 "think" 工具,提升 LLM 的推理能力和任务完成质量。
信息
分类
AI与计算