fix(plugin): auto-create mcp.json for MCP server connectivity#1106
Merged
Conversation
Plugin installation did not create ~/.claude/mcp.json, causing MCP tools (parse_mode, etc.) to be unavailable despite plugin hooks working. - Add createMcpJson() to build.ts — generates .mcp.json for npm package - Add _ensure_mcp_json() to session-start.py — creates or merges codingbuddy entry into ~/.claude/mcp.json at runtime - Preserve existing MCP server configurations (only adds codingbuddy) - Do not overwrite user's custom codingbuddy configuration - Handle corrupted mcp.json gracefully (fallback to empty) - 4 new tests for mcp.json creation/merge/preserve/corruption Closes #1100
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
~/.claude/mcp.json, causing MCP tools to be unavailablebuild.ts: AddcreateMcpJson()to generate.mcp.jsonfor npm package inclusionsession-start.py: Add_ensure_mcp_json()to create/merge codingbuddy entry into~/.claude/mcp.jsonat runtimemcp.jsongracefullyTest plan
test_creates_mcp_json_when_missing— creates file with codingbuddy entrytest_merges_into_existing_mcp_json— adds entry while preserving other serverstest_does_not_overwrite_existing_codingbuddy— respects user customizationstest_handles_corrupted_mcp_json— recovers from invalid JSONyarn buildgenerates.mcp.jsonin plugin directoryCloses #1100