Think Tool 分解器
MCP服务器对Anthropic的Think Tool提示工程技巧的实现,使克劳德能够通过提供一个简单地回响思维的工具来分解复杂问题并增强其推理能力。
服务介绍
MCP Think Tool
这是 Anthropic 在其工程博客文章中描述的“思考工具”作为 MCP 服务器的一个实现。Think Tool 是一种简单但有效的提示工程技术,它帮助 Claude 分解复杂问题并增强其推理能力。
工作原理
Think Tool 非常简单——它提供了一个不执行任何操作的工具,除了回显输入之外什么也不做。它的魔力在于它如何让 Claude 做到以下几点:
- 后退一步,仔细思考复杂问题
- 将推理分解为离散步骤
- 更系统地组织思路
- 在复杂的计算过程中缓存中间结果
- 在解决问题时展示其工作过程
正如 Anthropic 所述,这是一种“提示工程技术”,他们使用标准的工具调用机制定义了一个名为“think”的工具,该工具“完全不执行任何操作”——没有实际实现——它只是允许模型利用现有的关于何时使用工具的训练来暂停,并将额外的想法倾注到上下文中。
实现细节
MCP 服务器暴露了一个工具:
think- 接收一个想法作为输入并返回它
工具定义:
{
"name": "think",
"description": "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
"input_schema": {
"type": "object",
"properties": {
"thought": {
"type": "string",
"description": "A thought to think about."
}
},
"required": ["thought"]
}
}
使用方法
设置
- 克隆此仓库
- 运行
npm install安装依赖项 - 运行
npm run build编译 TypeScript - 运行
npm start启动 MCP 服务器
连接到 Claude 桌面版
在你的 Claude Desktop 配置文件中添加这个服务器:
{
"mcpServers": {
"think-tool": {
"command": "node",
"args": ["/path/to/mcp-think-tool/build/index.js"]
}
}
}
添加这个提示以教 LLM 如何使用 think 工具:
## Using 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
Here are some examples of what to iterate over inside the think tool:
<think_tool_example_1>
User wants to cancel flight ABC123
- Need to verify: user ID, reservation ID, reason
- Check cancellation rules:
* Is it within 24h of booking?
* If not, check ticket class and insurance
- Verify no segments flown or are in the past
- Plan: collect missing info, verify rules, get confirmation
</think_tool_example_1>
<think_tool_example_2>
User wants to book 3 tickets to NYC with 2 checked bags each
- Need user ID to check:
* Membership tier for baggage allowance
* Which payments methods exist in profile
- Baggage calculation:
* Economy class × 3 passengers
* If regular member: 1 free bag each → 3 extra bags = $150
* If silver member: 2 free bags each → 0 extra bags = $0
* If gold member: 3 free bags each → 0 extra bags = $0
- Payment rules to verify:
* Max 1 travel certificate, 1 credit card, 3 gift cards
* All payment methods must be in profile
* Travel certificate remainder goes to waste
- Plan:
1. Get user ID
2. Verify membership level for bag fees
3. Check which payment methods in profile and if their combination is allowed
4. Calculate total: ticket price + any bag fees
5. Get explicit confirmation for booking
</think_tool_example_2>
将 /path/to/mcp-think-tool 替换为此存储库的实际路径。
示例
Claude 可能会使用 Think Tool 来解决如下问题:
Solving 235 × 47:
Think: First I'll break this down. I need to multiply 235 by 47.
Think: I'll start by calculating 235 × 40 = 9,400
Think: Then I'll calculate 235 × 7 = 1,645
Think: Now I add them together: 9,400 + 1,645 = 11,045
Therefore, 235 × 47 = 11,045
或者对于更复杂的推理任务:
Think: I need to analyze the given problem carefully. The question asks about the impact of reducing carbon emissions by 15% over 5 years.
Think: First, I should establish the baseline emissions. The document mentions current annual emissions of 50 million metric tons.
Think: 15% reduction over 5 years means approximately 3% reduction per year, assuming linear decrease.
Think: After 5 years, annual emissions would be 50 × (1 - 0.15) = 50 × 0.85 = 42.5 million metric tons.
Think: The total reduction over 5 years would be the sum of the reductions each year...
开发
src/index.ts- MCP 服务器实现
许可证
ISC