MCP互动
](https://www.npmjs.com/package/mcp-interactive) ](https://www.npmjs.com/package/mcp-interactive)  ](https://github.com/ivan-mezentsev/mcp-interactive/issues)
一种交互式MCP(模型上下文协议)服务器,具有用于用户交互的Electron接口。
主要特点
此MCP服务器增强了LLM协调,提供了更大的控制和可预测性,并通过最大限度地减少单个任务中的用户交互来显著减少计费请求。
有关更改的详细历史记录,请参阅 更新日志.
演示
兼容性
- 测试和确认:
- 带来IDE - Claude for Mac - 增强码 - 光标IDE - 带副驾驶的VSCode
可用工具
ask_user -通过弹出命令提示向用户提示问题,并等待他们的交互式响应。
输入架构:
{
"type": "object",
"properties": {
"projectName": {
"type": "string",
"description": "Identifies the context/project making the request"
},
"message": {
"type": "string",
"description": "The specific question for the user. Supports Markdown formatting."
},
"predefinedOptions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Predefined options for the user to choose from (optional)"
}
},
"required": [
"projectName",
"message"
]
}安装
使用npx
{
"mcpServers": {
"interactive": {
"command": "npx",
"args": [
"mcp-interactive",
"-t",
"300"
]
}
}
}本地安装
安装依赖项:
npm install配置MCP服务器:
{
"mcpServers": {
"interactive": {
"command": "node",
"args": [
"/path/to/project/mcp-interactive/index.js",
"-t",
"300"
]
}
}
}系统提示建议 *Visual Studio Code*, *光标IDE*
## Decision Making
- **Ambiguous tasks**: ALWAYS clarify using `mcp_interactive_ask_user` tool
- **Requires decisions**: ALWAYS clarify using `mcp_interactive_ask_user` tool
## Code Development
- **Final confirmation**: MUST ask user if all requirements from specification are completed using `mcp_interactive_ask_user` tool with work report
## Final gate
- Before ANY final answer (after actions/edits/checks), it is **MANDATORY** to call `mcp_interactive_ask_user` with a report on the work done and the option ["Yes, everything is OK"].
- If the answer is not "Yes, everything is OK" — continue working until the comments are resolved and repeat every time `mcp_interactive_ask_user`.
- There are no exceptions (including minor edits).聊天中的“Human In The Loop”模式示例 *Visual Studio Code*
Can you check the docs and explain how the project works? #interactive系统提示建议 *带来IDE*
本节概述了LLM的系统提示或规则的建议指南,以确保最佳的交互和任务执行。
## Decision Making
- **Ambiguous tasks**: ALWAYS clarify using `ask_user` tool via MCP
- **Requires decisions**: ALWAYS clarify using `ask_user` tool via MCP
## Code Development
- **Final confirmation**: MUST ask user if all requirements from specification are completed using `ask_user` tool via MCP with work report
## Final gate
- Before ANY final answer (after actions/edits/checks), it is **MANDATORY** to call `ask_user` with a report on the work done and the option ["Yes, everything is OK"].
- If the answer is not "Yes, everything is OK" — continue working until the comments are resolved and repeat every time `ask_user`.
- There are no exceptions (including minor edits).命令行选项
--timeout或-t(秒):指定用户响应对话框的等待时间。如果在此期间未收到任何回复,将发送回复“用户未回复:发生超时。”。
故障排除
常见问题
电子未启动:
- 确保安装了当前版本的Node.js
- 尝试通过运行以下命令重新安装依赖关系:
npm install
应答超时问题(进度条):
- 使用增加超时值
-t参数 - 默认超时为60秒,可根据需要进行调整
贡献
欢迎投稿!请随时提交拉取请求。对于重大更改,请先打开一个问题来讨论您想要更改的内容。
请确保根据需要更新测试,并遵循现有的代码风格。
支持
如果您遇到任何问题或有疑问,请 打开一个问题 在GitHub上。
依赖项
此项目包括以下内容的本地副本 marked.js (marked.min.js)用于Markdown解析功能。Marked是根据MIT许可证授权的,由Marked.js团队和贡献者维护。
许可证
麻省理工学院
第三方许可证
- marked.js:MIT许可证-版权所有(c)2018+,MarkedJS贡献者
