MCP反射工具
一个模型上下文协议(MCP)服务器,为人工智能助手提供“反映”工具,以创建认知检查点和结构化推理。该工具帮助LLM维护上下文,反思他们的工作,并系统地思考复杂的问题。
为什么要使用这个工具?
关键见解: 如果不明确地输出思维过程,就不会发生深入思考。该工具创建了强制性的认知检查点,以防止捷径并提高准确性。
特性
- 🧠 结构化推理:迫使人工智能助手逐步思考复杂问题
- ✅ 任务验证:创建检查点以验证是否满足要求
- 📝 学习文档:在解决问题的过程中捕捉发现和见解
- 🔍 调试辅助设备:通过消除来帮助系统地解决问题
- 🎯 决策审计追踪:为重要决策创建推理记录
安装
通过NPM快速安装
# Install globally
npm install -g mcp-reflection-tool
# Or run directly with npx (no installation needed)
npx mcp-reflection-tool与AI工具集成
克劳德代码
使用单个命令添加服务器:
mcp add npx mcp-reflection-tool这将在您的Claude Code设置中自动配置服务器。运行命令后,完全重新启动Claude Code。
光标
添加到游标配置中:
选项1:通过设置UI
- 打开光标设置(Cmd/Ctrl+,)
- 搜索“MCP”或导航到功能>MCP
- 添加反射工具配置
选项2:直接配置编辑
编辑 ~/.cursor/mcp_config.json:
{
"mcpServers": {
"reflection-tool": {
"command": "npx",
"args": ["mcp-reflection-tool"]
}
}
}更改后重新启动Cursor。
帆板运动
添加到您的Windsurf MCP配置中:
位置: ~/.windsurf/mcp.json (macOS/Linux)或 %USERPROFILE%\.windsurf\mcp.json (Windows)
{
"mcpServers": {
"reflection-tool": {
"command": "npx",
"args": ["mcp-reflection-tool"]
}
}
}重新启动Windsurf以应用更改。
Cline(VS代码扩展)
选项1:通过VS代码设置界面
- 打开VS代码设置(Cmd/Ctrl+,)
- 搜索“临床MCP”
- 添加服务器配置
选项2:编辑settings.json
添加到您的VS代码 settings.json:
{
"cline.mcpServers": {
"reflection-tool": {
"command": "npx",
"args": ["mcp-reflection-tool"]
}
}
}配置后重新加载VS代码窗口。
替代方案:手动服务器模式
默认情况下,服务器通过stdio运行。如果需要HTTP模式,请使用环境变量:
# Start server in stdio mode (default)
npx mcp-reflection-tool
# Start in HTTP mode on port 8080
HTTP=true npx mcp-reflection-tool
# Start in HTTP mode on custom port
HTTP=true PORT=3000 npx mcp-reflection-tool大多数现代AI工具自动支持stdio模式。
使用示例
安装后,AI助手将可以访问 reflect 工具。以下是如何使用它的示例:
复杂行动之前
Using reflection tool: "Breaking down authentication implementation:
1. Check existing auth patterns in codebase
2. Set up JWT token generation
3. Add middleware for route protection
4. Test with valid and expired tokens"完成任务后
Using reflection tool: "Task completion check:
- Completed: Implemented user authentication with JWT
- Learned: Existing middleware made integration smooth
- Technical debt: Need to add rate limiting
- Next: Update API documentation"在问题解决过程中
Using reflection tool: "Debugging slow API responses:
- Symptom: 5+ second response times
- Hypothesis 1: Missing database indexes - CONFIRMED
- Hypothesis 2: N+1 query problem - Also found
- Solution: Added compound indexes and query batching
- Result: Response time now 输出>从下拉列表中选择“Cline”
- **游标日志**:帮助>切换开发人员工具>控制台
### 验证安装
Check if package is installed globally
npm list -g mcp-reflection-tool
Test the server directly
npx mcp-reflection-tool
Test stdio mode
echo '{"jsonrpc":"2.0","method":"initialize","id":1}' | npx mcp-reflection-tool
## 贡献
欢迎投稿!请随时提交拉取请求。
1. 分叉存储库
1. 创建功能分支(`git checkout -b feature/amazing-feature`)
1. 提交您的更改(`git commit -m 'Add amazing feature'`)
1. 推到分支(`git push origin feature/amazing-feature`)
1. 打开拉取请求
## 许可证
MIT许可证-有关详细信息,请参阅许可证文件。
## 作者
作为MCP实现创建,用于增强AI推理能力。
## 链接
-
-
- [模型上下文协议文档](https://modelcontextprotocol.io/)
- [报告问题](https://github.com/sterling/think-tool/issues)
## 致谢
- 内置于 [FastMCP](https://github.com/spencerc99/fastmcp) 框架
- 实施 [模型上下文协议](https://modelcontextprotocol.io/) 标准
- 受人工智能系统结构化推理研究的启发