From dafe725f60894a596a20c096ec022e21bc8e62db Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 13 Mar 2026 17:02:57 -0400 Subject: [PATCH] plugin: fix directory structure to match Claude Code plugin system The plugin used a non-standard directory layout that didn't match Claude Code's expected plugin structure, causing installation to fail. - Move marketplace.json to .claude-plugin/marketplace.json - Move claude_plugin.json to .claude-plugin/plugin.json with correct schema - Move mcp/semcode.json to .mcp.json with correct format (no mcpServers wrapper) - Update install.sh to point at directory instead of json file - Update documentation to reflect new paths Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/claude-semcode-setup.md | 4 +- plugin/{ => .claude-plugin}/marketplace.json | 7 +- plugin/README.md | 17 ++-- plugin/semcode/.claude-plugin/plugin.json | 9 +++ plugin/semcode/.mcp.json | 7 ++ plugin/semcode/README.md | 15 ++-- plugin/semcode/claude_plugin.json | 27 ------- plugin/semcode/install.sh | 29 +++---- plugin/semcode/mcp/config.md | 85 -------------------- plugin/semcode/mcp/semcode.json | 10 --- 10 files changed, 47 insertions(+), 163 deletions(-) rename plugin/{ => .claude-plugin}/marketplace.json (70%) create mode 100644 plugin/semcode/.claude-plugin/plugin.json create mode 100644 plugin/semcode/.mcp.json delete mode 100644 plugin/semcode/claude_plugin.json delete mode 100644 plugin/semcode/mcp/config.md delete mode 100644 plugin/semcode/mcp/semcode.json diff --git a/docs/claude-semcode-setup.md b/docs/claude-semcode-setup.md index 6a36095..e035611 100644 --- a/docs/claude-semcode-setup.md +++ b/docs/claude-semcode-setup.md @@ -33,7 +33,7 @@ Bigger ranges take longer, so it's better to just index what you need. ## Configuring MCP for Claude -claude plugins are the preferred way to configure things, but you can also +Claude Code plugins are the preferred way to configure things, but you can also setup a json file with details about the MCP server. The documentation below describes both. @@ -65,7 +65,7 @@ For detailed information about tool approval methods and troubleshooting, see [. ### Configuring Claude via the --mcp-config command line option -If claude plugins aren't right for your configuration, passing the mcp config +If Claude Code plugins aren't right for your configuration, passing the mcp config on the command line is also possible. ``` diff --git a/plugin/marketplace.json b/plugin/.claude-plugin/marketplace.json similarity index 70% rename from plugin/marketplace.json rename to plugin/.claude-plugin/marketplace.json index 07872e8..d9460b1 100644 --- a/plugin/marketplace.json +++ b/plugin/.claude-plugin/marketplace.json @@ -7,16 +7,13 @@ "plugins": [ { "name": "semcode", + "source": "./semcode", "version": "1.0.0", "description": "Semantic code search for C/C++ codebases with git-aware lookups, call graph analysis, and vector search", "author": { "name": "Semcode" }, - "homepage": "https://github.com/masoncl/semcode", - "source": "./plugin/semcode", - "mcpServers": [ - "./mcp/semcode.json" - ] + "keywords": ["c", "cpp", "code-search", "semantic-search", "call-graph", "git-integration"] } ] } diff --git a/plugin/README.md b/plugin/README.md index 6bfeb5f..bb5acc8 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -22,7 +22,7 @@ semcode-index --source . # 4. Install plugin cd /path/to/semcode -claude plugin marketplace add $(pwd)/plugin/marketplace.json +claude plugin marketplace add $(pwd)/plugin claude plugin install semcode@semcode-local # 5. Restart Claude and verify @@ -33,14 +33,17 @@ claude plugin install semcode@semcode-local ``` plugin/ -├── README.md # This file -├── marketplace.json # Plugin marketplace manifest -└── semcode/ # Plugin implementation - ├── README.md # Full installation and usage guide +├── .claude-plugin/ +│ └── marketplace.json # Plugin marketplace manifest +├── README.md # This file +└── semcode/ # Plugin implementation + ├── .claude-plugin/ + │ └── plugin.json # Plugin manifest + ├── .mcp.json # MCP server configuration + ├── README.md # Full installation and usage guide ├── TOOL_APPROVAL.md ├── approve-tools.sh - ├── install.sh - └── mcp/ # MCP server configuration + └── install.sh ``` ## Documentation diff --git a/plugin/semcode/.claude-plugin/plugin.json b/plugin/semcode/.claude-plugin/plugin.json new file mode 100644 index 0000000..84a25cc --- /dev/null +++ b/plugin/semcode/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "semcode", + "description": "Semantic code search for C/C++ codebases with git-aware lookups, call graph analysis, and vector search capabilities", + "version": "1.0.0", + "author": { + "name": "Semcode" + }, + "license": "MIT OR Apache-2.0" +} diff --git a/plugin/semcode/.mcp.json b/plugin/semcode/.mcp.json new file mode 100644 index 0000000..6d89fb9 --- /dev/null +++ b/plugin/semcode/.mcp.json @@ -0,0 +1,7 @@ +{ + "semcode": { + "command": "semcode-mcp", + "args": [], + "env": {} + } +} diff --git a/plugin/semcode/README.md b/plugin/semcode/README.md index ec48785..ec9effb 100644 --- a/plugin/semcode/README.md +++ b/plugin/semcode/README.md @@ -33,7 +33,7 @@ This creates a `.semcode.db` directory in your codebase. ```bash # Add the marketplace cd /path/to/semcode -claude plugin marketplace add $(pwd)/plugin/marketplace.json +claude plugin marketplace add $(pwd)/plugin # Install the plugin claude plugin install semcode@semcode-local @@ -62,17 +62,14 @@ claude # Uses /path/to/another-project/.semcode.db ### Optional: Fixed Database Path -To always use the same database, edit `plugin/semcode/mcp/semcode.json`: +To always use the same database, edit `plugin/semcode/.mcp.json`: ```json { - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "semcode-mcp", - "args": ["--database", "/absolute/path/to/your/codebase"], - "env": {} - } + "semcode": { + "command": "semcode-mcp", + "args": ["--database", "/absolute/path/to/your/codebase"], + "env": {} } } ``` diff --git a/plugin/semcode/claude_plugin.json b/plugin/semcode/claude_plugin.json deleted file mode 100644 index 63ddb20..0000000 --- a/plugin/semcode/claude_plugin.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "semcode", - "version": "1.0.0", - "description": "Semantic code search for C/C++ codebases with git-aware lookups, call graph analysis, and vector search capabilities", - "author": "semcode", - "license": "MIT OR Apache-2.0", - "mcp": { - "command": "semcode-mcp", - "args": [], - "env": {} - }, - "capabilities": [ - "code-search", - "call-graph-analysis", - "type-lookup", - "git-aware-search", - "semantic-search" - ], - "tags": [ - "c", - "cpp", - "code-search", - "semantic-search", - "call-graph", - "git-integration" - ] -} diff --git a/plugin/semcode/install.sh b/plugin/semcode/install.sh index bb7b30d..7bafa6d 100755 --- a/plugin/semcode/install.sh +++ b/plugin/semcode/install.sh @@ -45,7 +45,7 @@ echo # Step 1: Add marketplace echo "Step 1: Adding marketplace to Claude..." -if claude plugin marketplace add "$PLUGIN_DIR/marketplace.json"; then +if claude plugin marketplace add "$PLUGIN_DIR"; then echo "✓ Marketplace added successfully" else echo "⚠ Warning: Marketplace may already be added (this is OK)" @@ -98,40 +98,33 @@ case $choice in esac # Update MCP configuration if database path is provided +MCP_CONFIG="$SCRIPT_DIR/.mcp.json" if [ -n "$DB_PATH" ]; then - MCP_CONFIG="$SCRIPT_DIR/mcp/semcode.json" echo echo "Updating MCP configuration at: $MCP_CONFIG" # Create new config with database path cat > "$MCP_CONFIG" << EOF { - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "$MCP_BINARY", - "args": ["--database", "$DB_PATH"], - "env": {} - } + "semcode": { + "command": "$MCP_BINARY", + "args": ["--database", "$DB_PATH"], + "env": {} } } EOF echo "✓ Configuration updated" else # No database path specified, create config without --database arg - MCP_CONFIG="$SCRIPT_DIR/mcp/semcode.json" echo echo "Creating MCP configuration without database path: $MCP_CONFIG" cat > "$MCP_CONFIG" << EOF { - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "$MCP_BINARY", - "args": [], - "env": {} - } + "semcode": { + "command": "$MCP_BINARY", + "args": [], + "env": {} } } EOF @@ -223,7 +216,7 @@ echo "For usage examples and tool reference, see:" echo " $SCRIPT_DIR/../../docs/semcode-mcp.md" echo echo "To reconfigure the database path, edit:" -echo " $SCRIPT_DIR/mcp/semcode.json" +echo " $SCRIPT_DIR/.mcp.json" echo echo "To pre-approve tools for additional directories:" echo " $SCRIPT_DIR/approve-tools.sh /path/to/directory" diff --git a/plugin/semcode/mcp/config.md b/plugin/semcode/mcp/config.md deleted file mode 100644 index 880c158..0000000 --- a/plugin/semcode/mcp/config.md +++ /dev/null @@ -1,85 +0,0 @@ -# Semcode MCP Configuration - -This MCP server provides semantic code search capabilities for C/C++ codebases. - -## Default Configuration - -The default configuration uses `semcode-mcp` from your PATH with no database argument. -This means it will automatically look for `.semcode.db` in whatever directory Claude is running from. - -**How it works:** -- You run Claude from `/path/to/linux` -- Semcode-mcp looks for `/path/to/linux/.semcode.db` -- This allows you to work with different projects without reconfiguring - -## Custom Database Path (Advanced) - -If you want to use a specific database regardless of where Claude runs from, modify `semcode.json`: - -```json -{ - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "semcode-mcp", - "args": ["--database", "/absolute/path/to/your/codebase"], - "env": {} - } - } -} -``` - -## Using Absolute Path to Binary - -If `semcode-mcp` is not in your PATH, specify the full path: - -```json -{ - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "/home/user/semcode/target/release/semcode-mcp", - "args": [], - "env": {} - } - } -} -``` - -## Relative Path (Current Directory) - -To explicitly specify current directory: - -```json -{ - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "semcode-mcp", - "args": ["--database", "."], - "env": {} - } - } -} -``` - -This is equivalent to omitting `--database` entirely. - -## Verification - -After installation, verify by asking Claude: -``` -What semcode tools do you have access to? -``` - -You should see tools like: -- find_function -- find_type -- find_callers -- find_callees -- find_callchain -- grep_functions -- vgrep_functions -- diff_functions -- find_commit -- vcommit_similar_commits diff --git a/plugin/semcode/mcp/semcode.json b/plugin/semcode/mcp/semcode.json deleted file mode 100644 index a52bfb7..0000000 --- a/plugin/semcode/mcp/semcode.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "mcpServers": { - "semcode": { - "type": "stdio", - "command": "semcode-mcp", - "args": [], - "env": {} - } - } -}