思维伙伴MCP
一个模型上下文协议(MCP)服务器,在Claude Desktop和Claude Code之间创建一个统一的AI思维伙伴。这实现了架构思维和实施工作之间的无缝上下文共享和对话连续性。
快速开始
# Install dependencies
npm install
# Test the server
npm test
# Configure Claude Desktop
npm run setup-desktop
# Configure Claude Code
npm run setup-code
# Start development server
npm run dev魔术工作流程
上午设计会议(克劳德桌面)
- 设置焦点:“我正在进行身份验证系统设计”
- 架构讨论:探索方法,做出决定
- 自动记录:通过推理捕捉设计决策
实施会议(克劳德代码)
- 自动上下文:代码工具知道您的架构决策
- 实施发现:在编写代码时记录结果
- 反馈回路:实施见解为未来的设计提供信息
第二天(任一工具)
- 完全连续性:这两个工具都能记住你的推理
- 问题线索:开放式问题贯穿整个环节
- 模式识别:建立长期知识
可用工具
set_focus
设置您当前正在处理的内容-在两个工具之间共享
{
"topic": "user authentication refactor",
"context": "exploring JWT vs sessions",
"tool": "desktop"
}get_context
检索当前对话的相关上下文
{
"tool": "code",
"scope": "current"
}log_design_decision
捕获在Desktop中做出的架构选择
{
"decision": "Use JWT with refresh tokens",
"reasoning": "Better for distributed architecture",
"alternatives": ["session cookies", "OAuth only"]
}log_implementation_finding
记录编码过程中的发现
{
"finding": "JWT library requires specific token structure",
"code_context": "auth/token.js - jwt.sign() options"
}bridge_conversation
连接桌面和代码之间的对话
{
"from_tool": "desktop",
"to_tool": "code",
"summary": "Decided on JWT approach",
"open_questions": ["How to handle token rotation?"]
}项目结构
thinking-partner-mcp/
├── src/
│ ├── index.js # Main MCP server
│ ├── storage.js # JSON persistence layer
│ └── tools.js # Tool implementations
├── scripts/
│ ├── setup-desktop.js # Claude Desktop config
│ ├── setup-code.js # Claude Code config
│ └── test-server.js # Server testing
├── data/
│ └── context.json # Persistent context storage
└── package.json配置
安装脚本会自动配置Claude Desktop和Claude Code以使用此MCP服务器。服务器在本地运行,并在 data/context.json.
Git同步配置
服务器支持自动Git同步,以在多台机器之间共享上下文:
# Copy example environment file
cp .env.example .env
# Edit .env to add your Git repository
THINKING_PARTNER_GIT_REMOTE=git@github.com:yourusername/thinking-partner-data.git环境变量:
THINKING_PARTNER_GIT_SYNC:启用/禁用git同步(默认值:true)THINKING_PARTNER_AUTO_SYNC:启用/禁用保存时的自动同步(默认值:true)THINKING_PARTNER_GIT_REMOTE:用于同步数据的Git存储库URL
服务器将自动:
- 在数据目录中初始化Git存储库
- 读取上下文数据前拉取
- 保存更改后提交并推送
- 通过保留最新数据来处理合并冲突
示例用法
桌面会话:
User: "I'm designing a new API authentication system"
Claude: *sets focus and begins architectural discussion*
User: "Let's go with JWT tokens"
Claude: *logs decision with reasoning*代码会话:
$ claude-code
Claude: "I see you're implementing the JWT auth system we designed.
The decision was based on distributed architecture needs..."
User: "I'm having trouble with token refresh"
Claude: *implementation-focused help*
*logs discovery about refresh token complexity*下一个桌面会话:
Claude: "I notice from your implementation work that JWT refresh
tokens were more complex than expected. Should we
reconsider the architectural approach?"基金会
该工具创建了一种新的协作思维模式,人工智能成为你反思过程的延伸。与孤立的工具交互不同,您可以开发一个持续的对话,随着时间的推移建立理解。
真正的力量不在于个人特征,而在于通过持续使用而发展起来的新兴认知伙伴关系。
发展
# Start with file watching
npm run dev
# Test the server
npm test
# View current context
cat data/context.json | jq .延伸
模块化设计使添加新工具、资源或与其他AI平台集成变得容易。随着上下文的增长,存储层可以通过更复杂的持久性或搜索功能进行增强。

