Integrations
Provides cross-platform support for Linux environments, allowing LLMs to interact directly with users on their local Linux machines.
Supports running on macOS with specific recommendations for Terminal.app settings to ensure a smooth experience with the interactive MCP server.
Implements the Model Context Protocol (MCP) server in Node.js, allowing seamless integration with the local operating system for displaying notifications and command-line prompts.
交互式 MCP
一个用 Node.js/TypeScript 实现的 MCP 服务器,用于促进 LLM 与用户之间的交互通信。**注意:**此服务器设计为与 MCP 客户端(例如 Claude Desktop、VS Code)一起在本地运行,因为它需要直接访问用户的操作系统来显示通知和命令行提示符。
(注:该项目尚处于早期阶段。)
**想要快速了解一下?**请查看介绍性博客文章: 让你的 AI 助手不再猜测——interactive-mcp 介绍
演示视频 |
---|
工具
该服务器通过模型上下文协议(MCP)公开以下工具:
request_user_input
:向用户提问并返回答案。可以显示预定义选项。message_complete_notification
:发送简单的操作系统通知。start_intensive_chat
:启动持久命令行聊天会话。ask_intensive_chat
:在活跃的密集聊天会话中提出问题。stop_intensive_chat
:关闭活动的密集聊天会话。
演示
以下是交互功能的演示:
普通问题 | 完成通知 |
---|---|
密集聊天开始 | 密集聊天结束 |
---|---|
使用场景
此服务器非常适合 LLM 需要与本地计算机上的用户直接交互的场景,例如:
- 交互式设置或配置过程。
- 在代码生成或修改期间收集反馈。
- 在结对编程中澄清指令或确认操作。
- LLM 操作期间任何需要用户输入或确认的工作流程。
客户端配置
本节介绍如何配置 MCP 客户端以使用interactive-mcp
服务器。
默认情况下,用户提示将在 30 秒后超时。您可以在配置客户端时,通过在args
数组的"--"
后添加命令行标志来自定义服务器选项,例如超时或禁用工具。
请确保您有可用的npx
命令。
与 Claude Desktop/Cursor 一起使用
将以下最小配置添加到您的claude_desktop_config.json
(Claude Desktop)或mcp.json
(Cursor):
自定义超时示例(60 秒):
与 VS Code 一起使用
将以下最小配置添加到您的用户设置(JSON)文件或.vscode/mcp.json
:
macOS 建议
为了在 macOS 上使用默认Terminal.app
获得更流畅的体验,请考虑以下配置文件设置:
- (Shell 选项卡):在“当 Shell 退出时” (终端 > 设置 > 配置文件 > [您的配置文件] > Shell )下,选择**“如果 Shell 正常退出则关闭”或“关闭窗口”** 。这有助于在 MCP 服务器启动和停止时管理窗口。
- (高级选项卡):在“输入” (终端 > 设置 > 配置文件 > [您的配置文件] > 高级)下,取消选中**“删除键发送 Control-H”**选项。默认情况下,当您按下 Delete 键时,macOS 终端会发送 Control-H(ASCII 退格键)。取消选中此选项可能会对需要不同序列的应用程序有所帮助,但要实现特定序列(例如
\033[3~
,通常用于向前删除),可能仍需要其他配置或终端替代方案。
开发设置
本节主要面向希望修改或贡献服务器的开发者。如果您只想将服务器与 MCP 客户端一起使用,请参阅上面的“客户端配置”部分。
先决条件
- **Node.js:**检查
package.json
的版本兼容性。 - **pnpm:**用于包管理。安装 Node.js 后,通过
npm install -g pnpm
安装。
安装(开发人员)
- 克隆存储库:Copy
- 安装依赖项:Copy
运行应用程序(开发人员)
命令行选项
interactive-mcp
服务器接受以下命令行选项。这些选项通常应在 MCP 客户端的 JSON 设置中配置,方法是将它们添加到args
数组中,并以"--"
分隔符结尾(参见“客户端配置”示例)。
选项 | 别名 | 描述 |
---|---|---|
--timeout | -t | 设置用户输入提示的默认超时时间(以秒为单位)。默认为 30 秒。 |
--disable-tools | -d | 禁用特定工具或群组(逗号分隔列表)。阻止服务器广告或注册它们。选项: request_user_input 、 message_complete_notification 、 intensive_chat 。 |
**示例:**在客户端配置args
数组中设置多个选项:
开发命令
- 构建:
pnpm build
- Lint:
pnpm lint
- 格式:
pnpm format
互动指导原则
与此 MCP 服务器交互时(例如,作为 LLM 客户端),请遵守以下原则以确保清晰度并减少意外更改:
- **优先考虑互动:**频繁使用提供的 MCP 工具(
request_user_input
、start_intensive_chat
等)与用户互动。 - **寻求澄清:**如果要求、说明或上下文不清楚,请务必在继续操作之前提出澄清问题。不要妄下结论。
- **确认操作:**在执行重大操作(如修改文件、运行复杂命令或做出架构决策)之前,请与用户确认计划。
- **提供选项:**尽可能通过 MCP 工具向用户提供预定义的选项,以便快速做出决策。
您可以向 LLM 客户提供以下说明,如下所示:
贡献
欢迎贡献!请遵循标准开发实践。(更多详细信息可稍后添加)。
执照
MIT(有关详细信息,请参阅LICENSE
文件 - 如果适用,或直接指定许可证)。
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
交互式 MCP
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server to run commands.Last updated -2204104JavaScriptMIT License
- -securityAlicense-qualityAn MCP server that generates 2D and 3D game assets from text prompts using AI models from Hugging Face Spaces, allowing developers to easily create game art through Claude Desktop or other MCP clients.Last updated -34JavaScriptMIT License
- -securityFlicense-qualityAn MCP server that allows AI assistants like Claude to execute terminal commands on the user's computer and return the output, functioning like a terminal through AI.Last updated -7Python
- AsecurityFlicenseAqualityAn MCP server that leverages multiple Claude instances to provide enhanced responses by sending the same prompt to two separate instances and using a third to combine or select the best elements.Last updated -1JavaScript