commit 3c93879d5f08eec735468bb33037c92dc24a02a6 Author: Zhongwei Li Date: Sat Nov 29 18:22:57 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..fd1bdde --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "mcp-serena", + "description": "Serena MCP server for semantic code analysis and understanding", + "version": "1.0.0", + "author": { + "name": "David Lopes" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5502478 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# mcp-serena + +Serena MCP server for semantic code analysis and understanding diff --git a/commands/activate-serena.md b/commands/activate-serena.md new file mode 100644 index 0000000..ac1997f --- /dev/null +++ b/commands/activate-serena.md @@ -0,0 +1,84 @@ +--- +name: activate-serena +description: Activate Serena MCP semantic code analysis for the current or specified project +--- + +# Activate Serena for Project + +You will help the user activate Serena's semantic code analysis for a project. + +## What is Serena? + +Serena is an MCP server that provides IDE-like semantic code analysis capabilities: +- Symbol-based code navigation (find classes, methods, functions) +- Code structure understanding (get file overviews, symbol hierarchies) +- Reference tracking (find all usages of a symbol) +- Pattern searching with code context +- Supports 20+ programming languages + +## Activation Workflow + +Follow these steps: + +### Step 1: Determine Project to Activate + +Ask the user which project they want to activate using the `AskUserQuestion` tool: + +**Question**: "Which project would you like to activate Serena for?" + +**Options**: +1. **Current directory** - Activate the project in your current working directory +2. **Specific path** - Provide an absolute or relative path to a project directory + +### Step 2: Resolve the Path + +Based on the user's choice: +- **Current directory**: Use the working directory from the environment context +- **Specific path**: + - If relative path provided, resolve to absolute using `realpath` or similar + - If absolute path provided, use as-is + - Verify the path exists + +### Step 3: Activate the Project + +Call the Serena activation tool: +``` +mcp__plugin_core-mcps_serena__activate_project(project: "") +``` + +### Step 4: Confirm Success + +Display a success message to the user: +``` +✓ Serena activated for project: + +You can now use semantic code analysis tools: +- "Find all implementations of UserService" +- "Show me the structure of src/api/routes.ts" +- "Where is the processPayment function used?" +- "Find all classes that implement IRepository" +``` + +### Step 5: Check Onboarding + +After activation, call the onboarding check tool to see if the project has been onboarded: +``` +mcp__plugin_core-mcps_serena__check_onboarding_performed() +``` + +If onboarding hasn't been performed, inform the user that Serena may need a moment to index the codebase, and they can proceed with semantic queries. + +## Error Handling + +If activation fails: +- Check if the path exists and is a valid directory +- Verify the path contains code files +- Display the error message from Serena +- Ask if the user wants to try a different path + +## Important Notes + +- Serena indexes the project's code structure during activation +- This may take a few moments for large codebases +- Once activated, all semantic tools are available for that project +- The activation persists for the current Claude Code session \ No newline at end of file diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..5768d68 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:dnlopes/claude-code-plugins:mcp-serena", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "c39ebbc49d6b19e9a4c45b979f323354750d3f8e", + "treeHash": "5c7a6aa21fd8874aefaefabada6c4888352c782c7ec2862369716ed5cc8998dc", + "generatedAt": "2025-11-28T10:16:32.704458Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "mcp-serena", + "description": "Serena MCP server for semantic code analysis and understanding", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "92d1bf7772ecb1e55cd3d5820d5d1c3dd24effc977a44c01cf8426f42daff101" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "9af6b986b3df5d817fd60ee9fe5013643ece222eb51d2a5fa590890132e643fb" + }, + { + "path": "commands/activate-serena.md", + "sha256": "875f1c8fd69bf4f4550c31a797664361eab72200bf5bf5f77618da58c4b94f7d" + } + ], + "dirSha256": "5c7a6aa21fd8874aefaefabada6c4888352c782c7ec2862369716ed5cc8998dc" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file