MCP Hot-Reload 标志

MCP Hot-Reload

社区
neilopet

Hot Module Replacement (HMR) for MCP (Model Context Protocol) servers - instant reloading on file changes

发布者neilopet
代码仓库mcpmon
语言TypeScript
复刻数
2
星标数
10
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    MCP Hot-Reload 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 10 个 Star 和 2 个 Fork。

mcpmon

Node.js License: MIT Tests Code Style

Hot-reload monitor for MCP servers - like nodemon but for Model Context Protocol

Make changes to your MCP server code and see them instantly without restarting your MCP client. Just like nodemon automatically restarts Node.js applications, mcpmon automatically restarts MCP servers.

What it is

mcpmon is a transparent proxy that sits between your MCP client (Claude Code, Claude Desktop, MCP Inspector, etc.) and your MCP server. When you modify your server code, mcpmon automatically restarts the server while keeping your client connected.

Key benefits:

  • Like nodemon, but for MCP - Simple command-line interface you already know
  • Zero configuration - Just wrap your server command with mcpmon
  • Non-disruptive development - Your MCP client stays connected while your server reloads
  • Zero message loss - Requests are buffered during server restart
  • Universal compatibility - Works with any MCP server (Node.js, Python, Deno, etc.)
  • Library support - Import as a dependency for custom monitoring solutions

Quick Start

  1. Install globally:

    bash
    npm install -g mcpmon
  2. Use with your MCP server:

    bash
    # Instead of: node server.js
    mcpmon node server.js
    
    # Instead of: python server.py  
    mcpmon python server.py
    
    # Instead of: deno run --allow-all server.ts
    mcpmon deno run --allow-all server.ts
  3. Use with MCP clients:

    bash
    # MCP Inspector
    npx @modelcontextprotocol/inspector mcpmon node server.js
    
    # For existing Claude Code/Desktop servers, use setup:
    mcpmon setup my-server

    Setup automatically configures your existing MCP servers for hot-reload! ✨

That's it! Your MCP server now has hot-reload enabled. Edit your server code and changes apply instantly.

Usage Examples

Basic Usage

bash
# Node.js server
mcpmon node server.js

# Python server
mcpmon python -m mcp_server

# Python with args
mcpmon python server.py --port 3000

# Deno server
mcpmon deno run --allow-all server.ts

# With debugging
mcpmon node --inspect server.js

With MCP Inspector

bash
# Direct command
npx @modelcontextprotocol/inspector mcpmon node server.js

# With environment variables
API_KEY=your-key npx @modelcontextprotocol/inspector mcpmon node server.js

With Claude Code or Claude Desktop

Easiest way: Use the automatic setup command for existing servers:

bash
# Setup hot-reload for an existing server
mcpmon setup my-server

# Setup all stdio servers for hot-reload
mcpmon setup --all

# List available servers
mcpmon setup --list

# Restore original config if needed
mcpmon setup --restore

The setup command automatically:

  • ✅ Backs up your original configuration
  • ✅ Detects and uses modern Node.js versions for compatibility
  • ✅ Wraps your server command with mcpmon
  • ✅ Preserves all environment variables and arguments
  • ✅ Enables hot-reload instantly
  • ✅ Idempotent - safe to run multiple times

🔥 Claude Desktop Hot-Reload Tips

After setting up hot-reload:

  • Code changes: Your server automatically restarts - no action needed!
  • Schema changes (new tools/resources): Toggle the MCP server off/on in Claude Desktop settings
    • Go to Claude Desktop Settings → Features → Model Context Protocol
    • Toggle your server off, then back on
    • No restart needed - just the toggle!
  • Config changes: Restart Claude Desktop only if you modify the configuration file directly

Pro tip: For the best development experience, make code changes first, then schema changes. Claude Desktop will pick up tool calls from the latest hot-reloaded code even after schema updates!

Manual configuration: You can also manually update your config:

Claude Code (~/.claude_code_config):

json
{
  "mcpServers": {
    "my-server": {
      "command": "mcpmon",
      "args": ["node", "server.js"],
      "env": {
        "API_KEY": "your-key"
      }
    }
  }
}

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "my-server": {
      "command": "/Users/username/.nvm/versions/node/v22.15.0/bin/node",
      "args": ["/usr/local/bin/mcpmon", "python", "server.py"],
      "env": {
        "PYTHONPATH": "/path/to/your/modules"
      }
    }
  }
}

Note: The setup command automatically detects your latest Node.js version and mcpmon path. The above shows what the generated config looks like - you rarely need to write this manually!

Configuration

mcpmon works out of the box with zero configuration. It automatically detects your server file and starts watching for changes.

To watch additional files:

bash
# Watch multiple files
MCPMON_WATCH="server.js,config.json" mcpmon node server.js

That's it! mcpmon is designed to work with zero configuration.

Environment Variables

  • MCPMON_WATCH - Override files/directories to watch (comma-separated)
  • MCPMON_DELAY - Restart delay in milliseconds (default: 1000)
  • MCPMON_VERBOSE - Enable verbose logging

How It Works

mcpmon acts as a transparent proxy between your MCP client and server, providing automatic hot-reload capabilities:

The magic: Your MCP client stays connected while your server reloads. No need to reconnect Claude Code or restart MCP Inspector!

FeatureWithout mcpmonWith mcpmon
File changesManual restart requiredAutomatic restart
Client connectionMust reconnectStays connected
Lost messagesPossibleNever (buffered)
Setup complexityManual config changesJust add mcpmon

Need Help?

Enable verbose logging to see what's happening:

bash
MCPMON_VERBOSE=1 mcpmon node server.js

Common issues:

  • "ReadableStream is not defined"? mcpmon requires Node.js 16+. Use mcpmon setup to auto-detect modern Node.js versions
  • Server won't start? Check the error messages for missing dependencies
  • No hot reload? Verify your server file is being detected in the logs
  • Schema changes not visible? Toggle your MCP server off/on in Claude Desktop settings
  • Need help? See our Troubleshooting Guide

Development

bash
# Run tests (includes clean and build)
npm test

# Development mode
npm run dev

See Contributing Guide for more details.

Installation

Requirements: Node.js 16+ (automatically detected by setup command)

bash
# Install globally (recommended)
npm install -g mcpmon

# Or use without installing
npx mcpmon node server.js

Contributing

We welcome contributions! See Contributing Guide for details.

Documentation

License

MIT License - see LICENSE file for details.


Like nodemon? You'll love mcpmon. Simple, fast, and reliable hot-reload for MCP development.

将 MCP Hot-Reload MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP Hot-Reload 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 MCP Hot-Reload 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP Hot-Reload MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcpmon": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP Hot-Reload MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP Hot-Reload MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Hot-Reload 帮我完成这项任务吗?
MCP Hot-Reload
当然。我已阅读。
以下是我使用 MCP Hot-Reload 得到的结果。

常见问题

MCP Hot-Reload MCP 服务器有什么用途?

MCP Hot-Reload 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP Hot-Reload MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 MCP Hot-Reload,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 MCP Hot-Reload MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 MCP Hot-Reload 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP Hot-Reload MCP 连接到 TypingMind?

MCP Hot-Reload 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP Hot-Reload MCP 在 TypingMind 中提供哪些工具?

MCP Hot-Reload 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP Hot-Reload MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 MCP Hot-Reload 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇