Initial commit
This commit is contained in:
11
.claude-plugin/plugin.json
Normal file
11
.claude-plugin/plugin.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# mcp-serena
|
||||
|
||||
Serena MCP server for semantic code analysis and understanding
|
||||
84
commands/activate-serena.md
Normal file
84
commands/activate-serena.md
Normal file
@@ -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: "<absolute_path>")
|
||||
```
|
||||
|
||||
### Step 4: Confirm Success
|
||||
|
||||
Display a success message to the user:
|
||||
```
|
||||
✓ Serena activated for project: <project_path>
|
||||
|
||||
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
|
||||
45
plugin.lock.json
Normal file
45
plugin.lock.json
Normal file
@@ -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": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user