Skip to main content

Hot reload for MCP servers. Like nodemon, but for MCP.

Project description

mcpmon

Hot reload for MCP servers. Like nodemon, but for MCP.

Features

  • Hot reload - Restart server on file changes
  • Tool refresh - Sends notifications/tools/list_changed so Claude Code sees new tools without session restart
  • Gateway mode - Aggregate multiple MCP servers behind one gateway
  • Dual implementation - Python and Bun/TypeScript with full feature parity

Install

# Python
pip install mcpmon

# Bun (no install needed)
bunx mcpmon

# npm
npm install -g mcpmon

# Or download binary from GitHub releases (no dependencies)

Usage

Single Server Mode

mcpmon --watch src/ -- python -m my_mcp_server

Gateway Mode (Multi-Server)

mcpmon --config .mcpmon.yaml
# .mcpmon.yaml
servers:
  sage:
    command: sage-mcp
    watch: ~/.sage/src/

  crucible:
    command: crucible-mcp
    watch: ~/crucible/src/

  my-server:
    command: python
    args: ["-m", "my_server"]
    watch: ./src/
    extensions: py,json

Gateway aggregates tools with prefixes: sage__recall, crucible__review, etc.

Options

Option Description
-c, --config <file> Config file for multi-server gateway mode
-w, --watch <dir> Directory to watch (default: .)
-e, --ext <exts> Extensions to watch, comma-separated (default: py)
-q, --quiet Only show errors
-v, --verbose Show file change details
--debug Show all debug output
-t, --timestamps Include timestamps in output
-l, --log-file <file> Also write logs to file

Logging Levels

--quiet       Only errors
(default)     Start, stop, restart events + PID
--verbose     + file change details
--debug       + everything

Examples

# Basic - watch current directory for .py changes
mcpmon -- python server.py

# Watch specific directory and extensions
mcpmon --watch src/ --ext py,json -- python -m myserver

# With timestamps and log file
mcpmon --timestamps --log-file mcpmon.log -- python server.py

# Gateway mode - multiple servers
mcpmon --config .mcpmon.yaml

Sample Output

[mcpmon 16:08:50] Watching src/ for .py changes
[mcpmon 16:08:50 pid:53307] Started: python -m my_server
[mcpmon 16:08:54] File modified: tools.py
[mcpmon 16:08:54 pid:53307] Restarting...
[mcpmon 16:08:54 pid:53411] Started: python -m my_server
[mcpmon 16:08:54 pid:53411] Restart #1 complete
[mcpmon 16:08:54] Sent tools/list_changed notification

MCP Config

Single Server

{
  "mcpServers": {
    "my-server": {
      "command": "mcpmon",
      "args": ["--watch", "src/", "--", "python", "-m", "my_server"]
    }
  }
}

Gateway (Multiple Servers)

{
  "mcpServers": {
    "gateway": {
      "command": "mcpmon",
      "args": ["--config", ".mcpmon.yaml"]
    }
  }
}

How It Works

Single Server Mode

  1. Starts your MCP server as a subprocess
  2. Watches specified directory for file changes
  3. On change: SIGTERM → wait 2s → SIGKILL → restart
  4. Sends notifications/tools/list_changed notification
  5. Claude Code refreshes tool cache automatically

Gateway Mode

  1. Reads config file, starts all backend servers
  2. Aggregates tools from all backends (prefixed: backend__tool)
  3. Routes tool calls to correct backend
  4. Watches each backend's files independently
  5. Hot-reloads individual backends on change
  6. Hot-adds/removes backends when config changes

Development

# Python
pip install -e ".[dev]"
pytest tests/ -v  # 42 tests

# Bun/TypeScript
bun test  # 16 tests

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpmon-1.0.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpmon-1.0.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file mcpmon-1.0.0.tar.gz.

File metadata

  • Download URL: mcpmon-1.0.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpmon-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d217019d41583ce3ea31349b38ec052afac0531c1a08534934db549c9e2f29a8
MD5 195a9c174bf1f3954ad26210c21c425c
BLAKE2b-256 78f6439a1cc5fec2d2cf587d4e2f8cfbaec76ac7ebadf7ac028a9383dab19817

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpmon-1.0.0.tar.gz:

Publisher: release.yml on b17z/mcpmon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpmon-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mcpmon-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpmon-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9307c0a61237a65b2f531249e2fbd6fd5990e37378a9a1fa927a30897eee78
MD5 7b831167056663ab9389e03911f17e8f
BLAKE2b-256 ffea4eef077c72aabbaec4b196bb6692a224e4395c2b32a5b073794affc79679

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpmon-1.0.0-py3-none-any.whl:

Publisher: release.yml on b17z/mcpmon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page