
Serena MCP Server: Setup for Claude Code, Cursor and Other Apps
Gives Claude, Cursor and Codex IDE-style tools to find, understand and edit code across a whole project.
Serena lets your coding assistant look up and edit code by symbol, such as a function or class, instead of reading and rewriting whole files. It runs on your computer and talks to your assistant over your local setup, with no account or API key. The project says it sends no personal data or project data to outside servers, and collects only anonymous start-up counts that you can turn off. It can edit files, delete code and run shell commands by default, so read the safety section before you let it loose on a project you care about.
Install Serena with uv first, as shown in the box above, because the README advises against marketplace installs. It starts a small local dashboard in your browser by default.
Good for
- Developers working in large codebases where the assistant keeps reading whole files
- Claude Code, Codex and Cursor users who want precise rename and edit tools
- JetBrains users who want the assistant to use their IDE's own refactoring
- Teams who want project notes the assistant keeps between sessions
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Serena MCP: the IDE for your agent
Claude Code
- 1
Copy this prompt.
Add the Serena MCP: the IDE for your agent server to Claude Code. Run this command: claude mcp add --scope user serena -- serena start-mcp-server --context claude-code --project-from-cwd Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires uv, Serena installed with uv.
Read-only mode: Add --mode planning to the arguments. This turns off every tool that edits files or runs commands.
Install Serena first with the command from the README, then run serena init. Install: uv tool install -p 3.13 serena-agent.
From the project README. Source.
Tools
Finds a function, class or variable by name across your project
Looks up code symbols by name, or by a path such as a class and its method, using a language server. It can return the symbol's source and, optionally, its children.
Try: “Find the class that handles payments in this project and show me its methods.”
Files ·
find_symbolLists the classes and functions defined in one file
Returns the top-level symbols in a file, so the assistant sees a file's shape without reading all of it.
Try: “Give me an outline of src/billing/invoice.py.”
Files ·
get_symbols_overviewFinds every place a function or class is used
Lists the code that references a given symbol, with the surrounding lines.
Try: “Where is calculate_tax called from?”
Files ·
find_referencing_symbolsFinds the classes that implement an interface
Returns the implementations of a symbol such as an interface or abstract method.
Try: “Which classes implement PaymentProvider?”
Files ·
find_implementationsJumps to where something is defined
Finds the declaration or definition of a symbol that is used at a given spot in a file.
Try: “Where is the User type defined?”
Files ·
find_declarationSearches project files for text or a regular expression
Searches files for a pattern and returns the matching lines, with options to limit paths and include context lines.
Try: “Search the repo for every TODO that mentions caching.”
Files ·
search_for_patternReads a file from the project, or part of it
Reads a file inside the project directory, optionally only a range of lines.
Try: “Show me lines 1 to 80 of config/settings.py.”
Files ·
read_fileLists the files and folders in a directory
Lists a directory inside the project, with optional recursion.
Try: “What is in the tests folder?”
Files ·
list_dirFinds files by name or pattern
Finds files matching a name pattern under the paths you give.
Try: “Find every file named schema.sql.”
Files ·
find_fileShows errors and warnings the language server found in a file
Returns language-server diagnostics for a file, grouped by symbol.
Try: “Are there type errors in src/api/routes.ts?”
Files ·
get_diagnostics_for_fileShows errors and warnings for one function or class
Returns diagnostics for one symbol and, optionally, for the symbols that reference it. Off by default.
Try: “Check whether changing parse_config broke anything that calls it.”
Files ·
get_diagnostics_for_symbolRewrites a whole function or class in place
Replaces the full definition of a symbol with new code, found through the language server rather than line numbers.
Try: “Rewrite validate_email so it also rejects addresses without a domain.”
Write ·
replace_symbol_bodyAdds new code right after a function or class
Inserts content after the end of a symbol's definition.
Try: “Add a helper function after format_date.”
Write ·
insert_after_symbolAdds new code right before a function or class
Inserts content before the start of a symbol's definition, for example an import or a new method.
Try: “Add a new import before the first class in this file.”
Write ·
insert_before_symbolRenames a function or class everywhere it is used
Renames a symbol across the codebase using the language server's refactoring support.
Try: “Rename UserRecord to Account across the project.”
Write ·
rename_symbolDeletes unused code, or lists what still uses it
Deletes a symbol only if nothing references it. Otherwise it returns the list of references.
Try: “Delete the old legacy_export function if nothing uses it.”
Delete ·
safe_delete_symbolReplaces text in a file, with a plain string or a regex
Replaces matching content in a single file. Use it for edits smaller than a whole function.
Try: “In settings.py change DEBUG = True to DEBUG = False.”
Write ·
replace_contentReplaces text across many files, with a preview first
Replaces a pattern across several files. It supports a dry run and choosing which occurrences to change.
Try: “Preview replacing the old API URL with the new one in all config files.”
Write ·
replace_in_filesCreates a new file, or overwrites an existing one
Writes a file in the project directory. An existing file at that path is overwritten.
Try: “Create docs/CONTRIBUTING.md with a short contributor guide.”
Write ·
create_text_fileDeletes a range of lines from a file
Removes the lines between two line numbers. Off by default.
Try: “Delete lines 40 to 55 of utils.py.”
Delete ·
delete_linesReplaces a range of lines in a file
Swaps a range of lines for new content. Off by default.
Try: “Replace lines 12 to 20 with the new version of this block.”
Write ·
replace_linesInserts new content at a line number
Inserts content at a given line in a file. Off by default.
Try: “Insert a license header at line 1 of main.go.”
Write ·
insert_at_lineRuns a shell command in the project
Runs any shell command on your machine, such as tests or a build, and returns the output.
Try: “Run the test suite and tell me what failed.”
Runs code ·
execute_shell_commandPicks which project Serena works on
Activates a project by name or path so the other tools act on it. Needed in clients that do not start in your project folder.
Try: “Activate the current dir as project using serena.”
Files ·
activate_projectShows Serena's active projects, tools, contexts and modes
Prints the current agent configuration, including active and available projects, tools, contexts and modes.
Try: “Which Serena tools are enabled right now?”
Read ·
get_current_configHas the assistant learn the project and save notes about it
Identifies the project structure and key tasks such as testing and building, and stores what it learns as memories.
Try: “Onboard yourself to this project with Serena.”
Write ·
onboardingSaves a note about the project for later sessions
Writes a named markdown memory about the project that the assistant can read in future tasks.
Try: “Remember that we run tests with make test-fast.”
Write ·
write_memoryReads a saved project note
Reads the content of a memory file.
Try: “Read the memory about the build process.”
Files ·
read_memoryLists the saved project notes
Lists available memories, optionally filtered by topic.
Try: “What memories do you have for this project?”
Files ·
list_memoriesChanges part of a saved note
Replaces text in a memory that matches a regular expression.
Try: “Update the build memory to say we now use pnpm.”
Write ·
edit_memoryRenames or moves a saved note
Renames or moves a memory and updates references that use the mem: prefix.
Try: “Rename the memory 'setup' to 'dev/setup'.”
Write ·
rename_memoryDeletes a saved note
Deletes a memory file.
Try: “Delete the outdated memory about the old deploy script.”
Delete ·
delete_memoryOpens Serena's local dashboard in your browser
Opens the web dashboard, which shows logs, session information and tool usage statistics. Off by default.
Try: “Open the Serena dashboard.”
Runs code ·
open_dashboardRemoves a project from Serena's list
Removes a project from Serena's configuration. Off by default.
Try: “Remove the old-prototype project from Serena.”
Delete ·
remove_projectLists other projects the assistant may look things up in
Lists projects that can be queried with the query tool. Off by default.
Try: “Which other projects can you look at?”
Read ·
list_queryable_projectsRuns a read-only lookup in a different project
Runs a read-only Serena tool in another project and returns the result. Off by default.
Try: “In the shared-lib project, find the Logger class.”
Files ·
query_projectRuns Python code against Serena from inside the chat
Executes Python code that uses Serena's functionality programmatically. Marked beta and off by default.
Try: “Use the REPL to list all functions that call open_connection.”
Runs code ·
serena_replFinds symbols by name through your JetBrains IDE
Same as the symbol search but using the Serena JetBrains plugin as backend. Off by default.
Try: “Find the OrderService class with the JetBrains backend.”
Files ·
jet_brains_find_symbolFinds usages of a symbol through your JetBrains IDE
Finds symbols that reference the given symbol using the JetBrains backend. Off by default.
Try: “Where is PaymentGateway used?”
Files ·
jet_brains_find_referencing_symbolsOutlines a file through your JetBrains IDE
Retrieves the top-level symbols of a file using the JetBrains backend. Off by default.
Try: “Outline src/main/java/App.java.”
Files ·
jet_brains_get_symbols_overviewJumps to a definition through your JetBrains IDE
Finds the declaration of a symbol using the JetBrains backend. Off by default.
Try: “Go to the definition of Config.load.”
Files ·
jet_brains_find_declarationFinds implementations through your JetBrains IDE
Finds the implementations of a symbol using the JetBrains backend. Off by default.
Try: “Find implementations of the Repository interface.”
Files ·
jet_brains_find_implementationsShows parent and child types of a class
Retrieves the supertypes and/or subtypes of a symbol using the JetBrains backend. Off by default.
Try: “Show the subclasses of BaseController.”
Files ·
jet_brains_type_hierarchyRuns your IDE's code inspections on a file
Runs JetBrains IDE inspections on a file and returns the results. Off by default.
Try: “Run inspections on OrderService.java.”
Files ·
jet_brains_run_inspectionsLists the IDE inspections available
Lists available JetBrains IDE inspections, optionally filtered by language or group. Off by default.
Try: “Which Kotlin inspections can you run?”
Read ·
jet_brains_list_inspectionsRenames a symbol, file or folder through your IDE
Renames a symbol, file or directory throughout the codebase using the JetBrains backend. Off by default.
Try: “Rename the OrderDto class to OrderSummary.”
Write ·
jet_brains_renameMoves a symbol, file or folder and fixes references
Moves a symbol, file or directory to a new location and updates all references, using the JetBrains backend. Off by default.
Try: “Move the Logger class into the util package.”
Write ·
jet_brains_moveReplaces calls to a function with its body
Inlines a symbol by replacing all call sites with its body, using the JetBrains backend. Off by default.
Try: “Inline the helper function wrap_response.”
Write ·
jet_brains_inline_symbolDeletes a symbol after checking nothing uses it
Safely deletes a symbol using the JetBrains backend, checking for remaining usages first. Off by default.
Try: “Safely delete the unused LegacyClient class.”
Delete ·
jet_brains_safe_deleteDrives your IDE's debugger
Provides debugging through a persistent debug REPL connected to the JetBrains IDE: run configurations, breakpoints, stepping, inspection and evaluation. Off by default.
Try: “Set a breakpoint in checkout() and step through it.”
Runs code ·
jet_brains_debugUsed by the assistant behind the scenes
Gives the assistant Serena's usage manual
Returns Serena's instructions manual, for clients that do not pick up the instructions when the server connects.
Try: “Read Serena's initial instructions.”
Read ·
initial_instructionsRestarts the code-analysis server
Restarts the language servers. Useful when code was changed outside Serena. Off by default.
Try: “Restart the language server, I edited files by hand.”
Runs code ·
restart_language_serverLooks up an advanced Serena topic on demand
Returns information about an advanced topic when asked, to keep the assistant's context small. Off by default.
Try: “Look up how Serena modes work.”
Read ·
serena_info
Read from the source code
Permissions
high risk · 4 things to watch · 3 advisories
High risk
By default it can edit and delete project files and run shell commands on your machine. Add the planning mode for a read-only session, and keep your project in version control.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
It can run any shell command
The shell tool runs commands on your machine, and the project says the only full protection is a sandbox such as Docker. Use read-only mode or a container for code you do not trust. github.com
It can edit and delete code and files
Edit tools overwrite files and one tool deletes symbols that nothing uses. Keep the project under version control so you can undo changes. github.com
Optional tools add a Python console
A beta tool, off by default, runs Python code against Serena, and the project says tool limits do not apply to it. Leave it off unless you need it. github.com
Sends anonymous usage counts by default
On start it reports the version, operating system, interface, backend and context. Set SERENA_USAGE_REPORTING to false to stop it. github.com
Security advisories
3 known advisories, all fixed in a newer version.
- Server-Side Template Injection (SSTI) in mode/context prompt rendering → RCE on project activation, bypassing trusted_project_path_patternscritical · Fixed in 1.7.0 · GHSA-pp25-4cg4-qcr9
- Remote Code Execution via insecure pickle deserialization of LSP symbol cache (malicious repository → RCE on project activation)high · Fixed in 2.0.0 · GHSA-pp6p-xvxf-8hhx
- Serena: Unauthenticated Flask dashboard on fixed port enables DNS rebinding → memory poisoning → RCEhigh · Fixed in 1.5.2 · GHSA-37h2-6p4f-mp3q
Technical details
| Turning on read-only | Start the server with --mode planning. That mode excludes every tool marked as able to edit, including file edits, memory edits and shell commands. |
|---|---|
| Talks to | Anonymous start-up usage counts to the Serena project (can be turned off). Downloads language servers for your programming languages when needed |
| Sign-in and keys | No account or API key. Everything runs locally. |
| Data retention | Project notes (memories) are stored in your project folder. The project says no personal or project data is sent to external servers. |
Questions
Is Serena free?
Yes. It is open source under GPL-3.0-or-later and needs no account or API key. You pay only for the assistant you connect it to.
Which apps does Serena work with?
The project documents Claude Code, Codex, Claude Desktop, VS Code, Copilot CLI and JetBrains assistants. Other apps that can add a local server, such as Cursor, Windsurf and Cline, are covered by its general instructions. Use the install box above.
Can I run Serena read-only?
Yes. Start it with the planning mode and it keeps only tools that read. Edit, memory-write and shell tools are turned off in that mode.
Does Serena send my code anywhere?
The project says it sends no personal data or project data to external servers. It collects anonymous start-up counts, which you can turn off. Your assistant still sees whatever Serena returns, so your assistant's own data policy applies.
Why does Serena say not to use the marketplace?
The README warns that marketplace and plugin installs carry outdated and weaker install commands. It recommends installing with uv instead.
Do I need a language server?
By default Serena uses language servers to understand code, and some languages need extra tools installed. There is also a JetBrains plugin backend. Check the project's language support page for your language.
Is this list of tools complete?
The list covers the tools registered in the source. Many are off by default, and your client or context may hide others, so you may see fewer.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
serena-agent- Registry
- PyPI
- Transport
- stdio
- Version
- 1.5.3
- License
- GPL-3.0-or-later
- Last commit
- Oct 28, 2026
- Open issues
- 75
- Listed in
- Official MCP registry
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 6Hide
- Connecting your MCP client · github.com
- Serena README · github.com
- Serena tool sources · github.com
- Serena security · github.com
- Serena privacy · github.com
- Planning mode · github.com