-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Problem
mcp-hmr initializes reactivity.hmr.core.AsyncReloader with an empty watch path (""):
packages/mcp-hmr/mcp_hmr.py:super().__init__("")
Depending on platform / watcher backend, watching "" results in:
- no files being watched (hot reload silently does nothing), or
- startup/runtime errors from the watcher about an invalid path.
Expected behavior
mcp-hmr <target>:<attr> should watch the server code directory by default so edits trigger reloads reliably.
Actual behavior
Hot reload does not reliably trigger on file changes unless users patch mcp_hmr.py locally (e.g., hardcode a watch directory).
Reproduction
- Install
mcp-hmr==0.0.3.2 - Run:
mcp-hmr some.module:app(module target), ormcp-hmr ./path/to/server.py:app(path target)
- Edit a file inside the target server package/module (e.g., change a tool response)
- Observe: no reload (or watcher error), requiring server restart.
Proposed fix
Derive a stable watch directory from the target:
path:attr→ watch the parent directory of the filemodule:attr→ watch the directory containing the module/package on disk viafind_spec()- fallback →
cwd
PR
I have a PR ready that implements the above watch-path derivation #58
coderabbitai
Metadata
Metadata
Assignees
Labels
No labels