Skip to main content
Glama

Interactive MCP

MIT License
681
199
  • Apple
  • Linux

交互式 MCP

截图 2025-05-13 213745

一个用 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):

{ "mcpServers": { "interactive": { "command": "npx", "args": ["-y", "interactive-mcp"] } } }

有特定版本

{ "mcpServers": { "interactive": { "command": "npx", "args": ["-y", "interactive-mcp@1.9.0"] } } }

自定义超时示例(30 秒):

{ "mcpServers": { "interactive": { "command": "npx", "args": ["-y", "interactive-mcp", "-t", "30"] } } }

与 VS Code 一起使用

将以下最小配置添加到您的用户设置(JSON)文件或.vscode/mcp.json

{ "mcp": { "servers": { "interactive-mcp": { "command": "npx", "args": ["-y", "interactive-mcp"] } } } }
macOS 建议

为了在 macOS 上使用默认Terminal.app获得更流畅的体验,请考虑以下配置文件设置:

  • (Shell 选项卡):“当 Shell 退出时”终端 > 设置 > 配置文件 > [您的配置文件] > Shell )下,选择**“如果 Shell 正常退出则关闭”“关闭窗口”** 。这有助于在 MCP 服务器启动和停止时管理窗口。

开发设置

本节主要面向希望修改或贡献服务器的开发者。如果您只想将服务器与 MCP 客户端一起使用,请参阅上面的“客户端配置”部分。

先决条件

  • **Node.js:**检查package.json的版本兼容性。
  • **pnpm:**用于包管理。安装 Node.js 后,通过npm install -g pnpm安装。

安装(开发人员)

  1. 克隆存储库:
    git clone https://github.com/ttommyth/interactive-mcp.git cd interactive-mcp
  2. 安装依赖项:
    pnpm install

运行应用程序(开发人员)

pnpm start
命令行选项

interactive-mcp服务器接受以下命令行选项。这些选项通常应该在 MCP 客户端的 JSON 设置中配置,方法是直接将它们添加到args数组中(参见“客户端配置”示例)。

选项别名描述
--timeout-t设置用户输入提示的默认超时时间(以秒为单位)。默认为 30 秒。
--disable-tools-d禁用特定工具或群组(逗号分隔列表)。阻止服务器广告或注册它们。选项: request_user_inputmessage_complete_notificationintensive_chat

**示例:**在客户端配置args数组中设置多个选项:

// Example combining options in client config's "args": "args": [ "-y", "interactive-mcp", "-t", "30", // Set timeout to 30 seconds "--disable-tools", "message_complete_notification,intensive_chat" // Disable notifications and intensive chat ]

开发命令

  • 构建: pnpm build
  • Lint: pnpm lint
  • 格式: pnpm format

互动指导原则

与此 MCP 服务器交互时(例如,作为 LLM 客户端),请遵守以下原则以确保清晰度并减少意外更改:

  • **优先考虑互动:**频繁使用提供的 MCP 工具( request_user_inputstart_intensive_chat等)与用户互动。
  • **寻求澄清:**如果要求、说明或上下文不清楚,请务必在继续操作之前提出澄清问题。不要妄下结论。
  • **确认操作:**在执行重大操作(如修改文件、运行复杂命令或做出架构决策)之前,请与用户确认计划。
  • **提供选项:**尽可能通过 MCP 工具向用户提供预定义的选项,以便快速做出决策。

您可以向 LLM 客户提供以下说明,如下所示:

# Interaction - Please use the interactive MCP tools - Please provide options to interactive MCP if possible # Reduce Unexpected Changes - Do not make assumption. - Ask more questions before executing, until you think the requirement is clear enough.

贡献

欢迎贡献!请遵循标准开发实践。(更多详细信息可稍后添加)。

执照

MIT(有关详细信息,请参阅LICENSE文件 - 如果适用,或直接指定许可证)。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

从您的 LLM 向用户提问!interactive-mcp:本地、跨平台 MCP 服务器,用于交互式提示、聊天和通知。

  1. 工具
    1. 演示
      1. 使用场景
        1. 客户端配置
          1. 与 Claude Desktop/Cursor 一起使用
          2. 与 VS Code 一起使用
        2. 开发设置
          1. 先决条件
          2. 安装(开发人员)
          3. 运行应用程序(开发人员)
        3. 开发命令
          1. 互动指导原则
            1. 贡献
              1. 执照

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server that provides LLMs access to other LLMs
                  Last updated -
                  4
                  14
                  12
                  JavaScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A server for the Machine Chat Protocol (MCP) that provides a YAML-based configuration system for LLM applications, allowing users to define resources, tools, and prompts without writing code.
                  Last updated -
                  5
                  Python
                  MIT License
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).
                  Last updated -
                  1
                  12
                  1
                  JavaScript
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that allows agents to test and compare LLM prompts across OpenAI and Anthropic models, supporting single tests, side-by-side comparisons, and multi-turn conversations.
                  Last updated -
                  Python
                  MIT License

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/ttommyth/interactive-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server