用户操作MCP服务器
MCP(模型上下文协议)服务器,提供 user_steps 克劳德的工具。此工具允许代理向用户呈现分步清单,并自动打开交互式终端UI以完成。
安装
1.构建包
cd user-steps-mcp
npm install
npm run build
cd cli
npm install
npm run build2.配置克劳德代码
将MCP服务器添加到您的Claude Code配置中。选择以下方法之一:
选项A:项目级配置 (.mcp.json 在项目根目录中):
{
"mcpServers": {
"user-steps": {
"type": "stdio",
"command": "node",
"args": ["/path/to/user-steps-mcp/dist/index.js"]
}
}
}选项B:全局配置 (~/.claude.json):
{
"mcpServers": {
"user-steps": {
"type": "stdio",
"command": "node",
"args": ["/path/to/user-steps-mcp/dist/index.js"]
}
}
}选项C:通过Claude CLI:
claude mcp add user-steps node /path/to/user-steps-mcp/dist/index.js3.验证安装
claude mcp list用法
当Claude需要用户执行手动步骤时,它将调用 user_steps 工具,其中 自动打开一个新的终端窗口 带有交互式检查表UI。
该工具会阻塞并等待,直到用户完成步骤或取消会话。
配套CLI控件
| 关键 | 行动 |
|---|---|
| ↑/↓ | 导航步骤 |
| 空格/输入 | 切换步骤完成 |
| s | 切换跳过步骤 |
| f | 在步骤中添加反馈/注释 |
| c | 取消会话 |
工具模式
输入
{
title: string; // Title for the step list (max 50 chars)
description?: string; // Context explaining why these steps are needed
steps: [{
id: string; // Unique step identifier
title: string; // Step title (max 100 chars)
description?: string; // Detailed instructions
type?: 'action' | 'verification' | 'acknowledgment' | 'confirmation';
required?: boolean; // Default: true
dependsOn?: string[]; // Step IDs that must complete first
}];
allowPartialCompletion?: boolean; // Default: false
timeoutMs?: number; // Timeout in milliseconds
}输出
{
sessionId: string;
status: 'completed' | 'cancelled' | 'timeout' | 'partial';
steps: [{
id: string;
status: 'pending' | 'completed' | 'skipped';
completedAt?: string;
notes?: string;
}];
completedCount: number;
totalCount: number;
startedAt: string;
completedAt?: string;
}示例工具调用
{
"title": "Deploy to Production",
"description": "Complete these steps to deploy the new release",
"steps": [
{
"id": "backup",
"title": "Create database backup",
"description": "Run: pg_dump -h localhost production > backup.sql",
"type": "action"
},
{
"id": "verify",
"title": "Verify backup exists",
"type": "verification",
"dependsOn": ["backup"]
},
{
"id": "deploy",
"title": "Run deployment script",
"description": "Execute: ./deploy.sh production",
"type": "action",
"dependsOn": ["verify"]
}
]
}许可证
麻省理工学院
