You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/serena.md
+3-56Lines changed: 3 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,11 @@ sidebar:
5
5
order: 5
6
6
---
7
7
8
-
This guide covers using [Serena](https://github.com/oraios/serena), a powerful coding agent toolkit that provides semantic code retrieval and editing capabilities to agentic workflows.
8
+
[Serena](https://github.com/oraios/serena) is an MCP server that enhances AI agents with IDE-like tools for semantic code analysis and manipulation. It supports **30+ programming languages** through Language Server Protocol (LSP) integration, enabling agents to find symbols, navigate code relationships, and edit at the symbol level — ideal for navigating and editing large, well-structured codebases.
9
9
10
10
> [!CAUTION]
11
11
> `tools.serena` has been removed. Use the `shared/mcp/serena.md` shared workflow instead (see [Migration](#migration-from-toolsserena) below). Workflows that still use `tools.serena` will fail to compile.
12
12
13
-
## What is Serena?
14
-
15
-
Serena is an MCP server that enhances AI agents with IDE-like tools for semantic code analysis and manipulation. It supports **30+ programming languages** through Language Server Protocol (LSP) integration, enabling agents to find symbols, navigate relationships, edit at symbol level, and analyze code structure - all without reading entire files or performing text-based searches.
16
-
17
-
> [!TIP]
18
-
> Serena excels at navigating and manipulating complex codebases, especially for large, well-structured projects where precise code navigation and editing are essential.
19
-
20
13
## Quick Start
21
14
22
15
### Recommended: Import shared workflow
@@ -88,13 +81,6 @@ imports:
88
81
languages: ["go", "typescript"]
89
82
```
90
83
91
-
For Go-only workflows there is a shorthand:
92
-
93
-
```aw wrap
94
-
imports:
95
-
- shared/mcp/serena-go.md
96
-
```
97
-
98
84
The shared workflow configures the full Serena MCP server (container image, entrypoint, workspace mount) explicitly. Compiling a workflow that still uses `tools.serena` now fails with an error:
99
85
100
86
```
@@ -135,21 +121,6 @@ Serena provides semantic code tools organized into three categories:
135
121
136
122
These tools enable agents to work at the **symbol level** rather than the file level, making code operations more precise and context-aware.
137
123
138
-
## Memory Configuration
139
-
140
-
Serena caches language server indexes for faster operations. Create the cache directory in your workflow:
141
-
142
-
```bash
143
-
mkdir -p /tmp/gh-aw/cache-memory/serena
144
-
```
145
-
146
-
Optionally configure cache-memory in frontmatter:
147
-
```yaml wrap
148
-
tools:
149
-
cache-memory:
150
-
key: serena-analysis
151
-
```
152
-
153
124
## Usage Examples
154
125
155
126
### Find Unused Functions
@@ -171,29 +142,9 @@ tools:
171
142
3. Report findings
172
143
```
173
144
174
-
### Automated Refactoring
175
-
176
-
```aw wrap
177
-
---
178
-
engine: claude
179
-
imports:
180
-
- uses: shared/mcp/serena.md
181
-
with:
182
-
languages: ["python"]
183
-
tools:
184
-
edit:
185
-
---
186
-
187
-
# Add Type Hints
188
-
189
-
1. Find functions without type hints
190
-
2. Add annotations using `replace_symbol_body`
191
-
3. Verify correctness
192
-
```
193
-
194
145
## Best Practices
195
146
196
-
Configure cache directory early (`mkdir -p /tmp/gh-aw/cache-memory/serena`) for faster operations. Prefer symbol-level operations (`replace_symbol_body`) over file-level edits. Combine Serena with other tools like `github`, `edit`, and `bash` for complete workflows. For large codebases, start with targeted analysis of specific packages before expanding scope.
147
+
Pre-create the cache directory (`mkdir -p /tmp/gh-aw/cache-memory/serena`) for faster operations — Serena reuses language server indexes across runs. Pin the key with `tools.cache-memory.key: serena-analysis` in frontmatter to persist it. Prefer symbol-level operations (`replace_symbol_body`) over file-level edits. Combine Serena with other tools like `github`, `edit`, and `bash` for complete workflows. For large codebases, start with targeted analysis of specific packages before expanding scope.
197
148
198
149
## Troubleshooting
199
150
@@ -209,10 +160,6 @@ Configure cache directory early (`mkdir -p /tmp/gh-aw/cache-memory/serena`) for
209
160
-[Using MCPs](/gh-aw/guides/mcps/) - General MCP server configuration
0 commit comments