Fix/mcp server bugs - #16
Open
Tazovsky wants to merge 2 commits into
Open
Conversation
Three bugs prevented the MCP stdio server from working with Claude Code: 1. plugin.json hooks path pointed to ./hooks.json but the file lives at ./hooks/hooks.json, causing plugin load failure. 2. Handler functions output pretty-printed multi-line JSON, but MCP stdio transport expects NDJSON (one complete JSON object per line). Added send_response helper that pipes all output through jq -c for compaction. 3. Response IDs were hardcoded (1, 2, 3...) instead of echoing the request ID back. JSON-RPC requires response.id to match request.id. The send_response helper now sets the correct ID via --argjson. 4. get_daemon_status embedded a raw JSON object as the text field value, but MCP content[].text must be a string. Changed to use jq tojson to serialize the object into a JSON string. Also: handle notifications/initialized silently (no response needed), skip empty input lines to avoid parse errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The daemon and manager write PID and log files to the project's logs/ directory (via CLAUDE_NIGHTS_WATCH_DIR or CWD), but the MCP server was reading from PLUGIN_ROOT/logs/ (the plugin install directory). This caused get_daemon_status and get_logs to report the daemon as stopped and logs as missing even when the daemon was running. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
./hooks.json→./hooks/hooks.json)content[].textnotifications/initializedand empty lines gracefullyTest plan
get_daemon_statusreports "running"get_logsreturns actual log content