mcpField
M
Mcp Interactive

Mcp Interactive

本地服务
github.com/ivan-mezentsevAI 与智能体556 周前更新

关于 Mcp Interactive

Mcp Interactive 是带 Electron 界面的交互式 MCP 服务,适用于需要 Agent 在任务中向用户澄清问题或征求确认的场景。它通过弹窗提问并等待用户回复。

主要功能

  1. 01通过弹窗向用户提问
  2. 02等待用户交互式回复
  3. 03可配置回复等待超时
  4. 04支持多个 MCP 客户端

适用场景

  1. 01澄清含糊的任务要求
  2. 02在编码工作流中征求决策
  3. 03在交付前请求用户确认

MCP 相关

该 MCP 服务提供 ask_user 工具,以 Electron 弹窗提问并返回用户回复;客户端配置可指定等待超时。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"interactive": {
"command": "npx",
"args": [
"-y",
"mcp-interactive"
]
}
}
}
启动命令npx -y mcp-interactive

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmmcp-interactive

工具

1

收录的工具列表 · 更新于 3 周前

参数类型必填说明
projectNamestring是标识发起请求的上下文/项目
messagestring是向用户提出的具体问题。支持 Markdown 格式。
predefinedOptionsarray否供用户选择的预设选项(可选)

详细介绍

MCP Interactive

npm version npm downloads License: MIT GitHub issues

一个带有 Electron 界面的交互式 MCP(Model Context Protocol)服务,用于与用户互动。

主要功能

此 MCP 服务可增强大模型的协作能力,提供更高的控制力和可预测性,并通过减少单个任务中的用户交互,显著降低计费请求数量。

如需了解详细的变更历史,请参阅更新日志。

演示

演示

兼容性

  • 已测试并确认:
    • Trae IDE
    • Claude for Mac
    • augment code
    • Cursor IDE
    • 带有 Copilot 的 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、Cursor 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).
Visual Studio Code 聊天中的“人在回路中”模式示例
Can you check the docs and explain how the project works? #interactive

Trae IDE 的系统提示词建议

本节介绍系统提示词或规则的推荐准则,以确保大模型实现最佳交互和任务执行效果。

## 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(秒):指定等待用户响应对话框的时间。如果在此期间没有收到响应,将发送回复“用户未回复:发生超时。”

故障排除

常见问题

Electron 未启动:

  • 确保已安装当前版本的 Node.js
  • 尝试运行 npm install 重新安装依赖

答案超时问题(进度条):

  • 使用 -t 参数增大超时时间
  • 默认超时时间为 60 秒,可按需调整

贡献

欢迎贡献!欢迎提交 Pull Request。对于重大变更,请先提出 issue,讨论你希望进行的更改。

请确保适当更新测试,并遵循现有代码风格。

支持

如果遇到问题或有疑问,请在 GitHub 上提出 issue。

依赖项

本项目包含一份本地的 marked.js 副本(marked.min.js),用于解析 Markdown。Marked 采用 MIT 许可证,并由 Marked.js 团队及贡献者维护。

许可证

MIT

第三方许可证
  • marked.js:MIT 许可证 - 版权所有 (c) 2018+,MarkedJS 贡献者

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。