Skip to main content
Glama
  • Serena provides essential semantic code retrieval, editing, refactoring and debugging tools that are akin to an IDE's capabilities, operating at the symbol level and exploiting relational structure.

  • It integrates with any client/LLM via the model context protocol (MCP).

Serena's agent-first tool design involves robust high-level abstractions, distinguishing it from approaches that rely on low-level concepts like line numbers or primitive search patterns.

Practically, this means that your agent operates faster, more efficiently and more reliably, especially in larger and more complex codebases.

TIP

Serena v2 with the newREPL-based agent interface has been released.
Learn more about the new interface and how to configure it.

Video

Related MCP server: Nabu + Nisaba

What Our "End Users" Say

While it is humans who download and set up Serena, our end users are essentially AI agents. As the ones actually applying Serena's tools, they are in the best position to evaluate Serena.

We crafted an unbiased evaluation prompt that leads the agent to perform ~20 routine coding tasks, representative of everyday development work, in order to estimate the value added by Serena's tools when used alongside its own built-ins.

Here's a one-sentence summary of what the agents had to say:

Opus 4.6 (high) in Claude Code on a large Python codebase:

"Serena's IDE-backed semantic tools are the single most impactful addition to my toolkit – cross-file renames, moves, and reference lookups that would cost me 8–12 careful, error-prone steps collapse into one atomic call, and I would absolutely ask any developer I work with to set them up."

GPT 5.4 (high) in Codex CLI on a Java codebase:

"As a coding AI agent, I would ask my owner to add Serena because it gives me the missing IDE-level understanding of symbols, references, and refactorings, turning fragile text surgery into calmer, faster, more confident code changes where semantics matter."

GPT 5.4 (medium) in Copilot CLI on a large, multi-language monorepo:

"As a coding agent, I’d absolutely ask my owner to add Serena because it makes me noticeably sharper and calmer on real code – especially symbol-aware navigation, cross-file refactors, and monorepo dependency jumps – while I still lean on built-ins for tiny text edits and non-code work."

Different agents in different settings independently converge on the same verdict.

Give your agent the tools it has been asking for and add Serena MCP to your client!

See our documentation for the full methodology and much more detailed evaluation results, or run your own evaluation on a project of your choice.

How Serena Works

Serena provides the necessary tools for coding workflows, but an LLM is required to do the actual work, orchestrating tool use.

Serena can extend the functionality of your existing AI client via the model context protocol (MCP). Most modern AI chat clients directly support MCP, including

  • terminal-based clients like Claude Code, Codex, OpenCode, or Gemini-CLI,

  • IDEs and IDE assistant plugins for VSCode, Cursor and JetBrains IDEs (Copilot, Junie, JetBrains AI Assistant, etc.),

  • desktop and web clients like Claude Desktop, Codex App, or OpenWebUI.

:tv: See also: Introduction to Serena in 5 Minutes (YouTube)

To connect the Serena MCP server to your client, you either

  • provide the client with a launch command that allows it to start the MCP server, or

  • start the Serena MCP server yourself in HTTP mode and provide the client with the URL.

See the Quick Start section below for information on how to get started.

Programming Language Support & Semantic Analysis Capabilities

Serena provides a set of versatile code querying and editing functionalities based on symbolic understanding of the code. Equipped with these capabilities, your agent discovers and edits code just like a seasoned developer making use of an IDE's capabilities would. Serena can efficiently find the right context and do the right thing even in very large and complex projects!

There are two alternative technologies powering these capabilities:

  • Language servers implementing the language server protocol (LSP) — the free/open-source alternative which is used by default.

  • The Serena JetBrains Plugin, which leverages the powerful code analysis and editing capabilities of your JetBrains IDE (paid plugin; free trial available).

You can choose either of these backends depending on your preferences and requirements.

Language Servers

Serena incorporates a powerful abstraction layer for the integration of language servers that implement the language server protocol (LSP). The underlying language servers are typically open-source projects or at least freely available for use.

When using Serena's language server backend, we provide support for over 40 programming languages, including Ada / SPARK, AL, Angular, Ansible, Astro, Bash, BSL, C#, C/C++, Clojure, Crystal, CUE, Dart, Deno, Elixir, Elm, Erlang, Fortran, F#, GDScript, Gleam, GLSL, Go, GraphQL, Groovy, Haskell, Haxe, HLSL, HTML, Java, JavaScript, JSON, Julia, Kotlin, LaTeX, Lean 4, Lua, Luau, Markdown, MATLAB, mSL, Nextflow, Nix, OCaml, Pascal, Perl, PHP, PowerShell, Python, QML, R, Rego, Ruby, Rust, Scala, SCSS / Sass / CSS, Solidity, Svelte, Swift, SystemVerilog, Terraform, TOML, TypeScript, VB.NET, Vue, WGSL, Wolfram Language, YAML, and Zig.

The Serena JetBrains Plugin

The paid Serena JetBrains Plugin (free trial available) leverages the powerful code analysis capabilities of your JetBrains IDE. The plugin naturally supports all programming languages and frameworks that are supported by JetBrains IDEs, including IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, RubyMine, GoLand, and potentially others (Rider and CLion are unsupported though).

See our documentation page for further details and instructions on how to apply the plugin.

Features

Serena provides a wide range of tools for efficient code retrieval, editing and refactoring, as well as a memory system for long-lived agent workflows.

Given its large scope, Serena adapts to your needs by offering a multi-layered configuration system.

Retrieval

Serena's retrieval tools allow agents to explore codebases at the symbol level, understanding structure and relationships without reading entire files.

Capability

Language Servers

JetBrains Plugin

find symbol

yes

yes

symbol overview (file outline)

yes

yes

find referencing symbols

yes

yes

search in project dependencies

--

yes

type hierarchy

--

yes

find declaration

yes*

yes

find implementations

yes**

yes

query external projects

yes

yes

diagnostics/inspections

yes

yes

*: Will generally not work for declarations in external dependencies. **: Only available for some languages, limited by the language server functionality.

Refactoring

Without precise refactoring tools, agents are forced to resort to unreliable and expensive search and replace operations.

Capability

Language Servers

JetBrains Plugin

rename

yes (only symbols)

yes (symbols, files, directories)

move (symbol, file, directory)

--

yes

inline

--

yes

propagate deletions (remove unused code)

--

yes

Symbolic Editing

Serena's symbolic editing tools are less error-prone and much more token-efficient than typical alternatives.

Capability

Language Servers

JetBrains Plugin

replace symbol body

yes

yes

insert after symbol

yes

yes

insert before symbol

yes

yes

safe delete

yes

yes

Interactive Debugging

Exclusive to the JetBrains plugin, Serena supports a highly general debugging tool, which allows an agent to set breakpoints, inspect variables, evaluate expressions and control execution flow via a persistent REPL-style interface.

Basic Features

Beyond its semantic capabilities, Serena includes a set of basic utilities for completeness. When Serena is used inside an agentic harness such as Claude Code or Codex, these tools are typically disabled by default, since the surrounding harness already provides overlapping file, search, and shell capabilities.

  • search_for_pattern – flexible regex search across the codebase

  • replace_content – agent-optimised regex-based and literal text replacement

  • list_dir / find_file – directory listing and file search

  • read_file – read files or file chunks

  • execute_shell_command – run shell commands (e.g. builds, tests, linters)

Memory Management

A memory system is elemental to long-lived agent workflows, especially when knowledge is to be shared across sessions, users and projects. Despite its simplicity, we received positive feedback from many users who tend to combine Serena's memory management system with their agent's internal system (e.g., AGENTS.md files). It can easily be disabled if you prefer to use something else.

Configurability

Active tools, tool descriptions, prompts, language backend details and many other aspects of Serena can be flexibly configured on a per-case basis by simply adjusting a few lines of YAML. To achieve this, Serena offers multiple levels of (composable) configuration:

  • global configuration

  • MCP launch command (CLI) configuration

  • per-project configuration (with local overrides)

  • execution context-specific configuration (e.g. for particular clients)

  • dynamically composable configuration fragments (modes)

Quick Start

IMPORTANT

Do not install Serena via an MCP or plugin marketplace! They contain outdated and suboptimal installation commands.

Prerequisites. Serena is managed by uv, and installing uv is the only required prerequisite.

Install Serena. Serena is installed via uv as follows:

uv tool install -p 3.13 serena-agent

After successful installation, the command serena should be available in your shell.

NOTE

When using the language server backend, some additional dependencies may need to be installed to support certain languages; see theLanguage Support page for details.

Initialise Serena. To initialise Serena and verify that your setup works correctly, simply run:

serena init

By default, this will set up Serena to use the language server backend. To use the JetBrains backend instead, add the parameters -b JetBrains (see the JetBrains Plugin documentation page for additional usage details).
Either way, you should receive a success message indicating that Serena has been initialised successfully.

Configuring Your Client. To connect Serena to your preferred MCP client, you typically need to configure a launch command in your client. Follow the link for specific instructions on how to set up Serena for Claude Code, Codex, Claude Desktop, MCP-enabled IDEs and other clients (such as local and web-based GUIs).

TIP

While getting started quickly is easy, Serena is a powerful toolkit with many configuration options. We highly recommend reading through theuser guide to get the most out of Serena.

Specifically, we recommend to read about ...

User Guide

Please refer to the user guide for detailed instructions on how to use Serena effectively.

Partner Offerings

Acknowledgements

A significant part of Serena, especially support for various languages, was contributed by the open source community. We are very grateful for the many contributors who made this possible and who played an important role in making Serena what it is today.

License

Serena is licensed per component: SolidLSP (src/solidlsp) under the MIT License, the Serena application (everything else) under GPL-3.0-or-later. Distributions combining both are as a whole subject to the GPL.

See LICENSE for the authoritative overview and the license documentation for the background. Contributions require acceptance of our CLA; see CONTRIBUTING.md.

Available Tools

29 tools
activate_projectActivate ProjectB
Read-only

Activates the project with the given name or path.

Inputs: project (required). Returns: result

check_onboarding_performedCheck Onboarding PerformedA
Read-only

Checks whether project onboarding was already performed. You should always call this tool before beginning to actually work on the project/after activating a project.

Inputs: no named parameters. Returns: result

create_text_fileCreate Text FileA
Destructive

Write a new file or overwrite an existing file. Returns a message indicating success or failure.

Inputs: relative_path (required), content (required). Returns: result

delete_memoryDelete MemoryA
Destructive

Delete a memory file. Should only happen if a user asks for it explicitly, for example by saying that the information retrieved from a memory file is no longer correct or no longer relevant for the project.

Inputs: memory_file_name (required). Returns: result

edit_memoryEdit MemoryA
Destructive

Replaces content matching a regular expression in a memory.

Inputs: memory_file_name (required), needle (required), repl (required), mode (required). Returns: result

execute_shell_commandExecute Shell CommandA
Destructive

Execute a shell command and return its output. If there is a memory about suggested commands, read that first. Never execute unsafe shell commands! IMPORTANT: Do not use this tool to start

  • long-running processes (e.g. servers) that are not intended to terminate quickly,

  • processes that require user interaction. Returns a JSON object containing the command's stdout and optionally stderr output.

Inputs: command (required), cwd, capture_stderr, max_answer_chars. Returns: result

find_fileFind FileA
Read-only

Finds non-gitignored files matching the given file mask within the given relative path. Returns a JSON object with the list of matching files.

Inputs: file_mask (required), relative_path (required). Returns: result

find_referencing_symbolsFind Referencing SymbolsA
Read-only

Finds references to the symbol at the given name_path. The result will contain metadata about the referencing symbols as well as a short code snippet around the reference. Returns a list of JSON objects with the symbols referencing the requested symbol.

Inputs: name_path (required), relative_path (required), include_kinds, exclude_kinds, +1 more. Returns: result

find_symbolFind SymbolA
Read-only

Retrieves information on all symbols/code entities (classes, methods, etc.) based on the given name path pattern. The returned symbol information can be used for edits or further queries. Specify depth > 0 to also retrieve children/descendants (e.g., methods of a class).

A name path is a path in the symbol tree within a source file. For example, the method my_method defined in class MyClass would have the name path MyClass/my_method. If a symbol is overloaded (e.g., in Java), a 0-based index is appended (e.g. "MyClass/my_method[0]") to uniquely identify it.

To search for a symbol, you provide a name path pattern that is used to match against name paths. It can be

  • a simple name (e.g. "method"), which will match any symbol with that name

  • a relative path like "class/method", which will match any symbol with that name path suffix

  • an absolute name path "/class/method" (absolute name path), which requires an exact match of the full name path within the source file. Append an index [i] to match a specific overload only, e.g. "MyClass/my_method[1]". Returns a list of symbols (with locations) matching the name.

Inputs: name_path_pattern (required), depth, relative_path, include_body, +4 more. Returns: result

get_current_configGet Current ConfigA
Read-only

Print the current configuration of the agent, including the active and available projects, tools, contexts, and modes.

Inputs: no named parameters. Returns: result

get_symbols_overviewGet Symbols OverviewA
Read-only

Use this tool to get a high-level understanding of the code symbols in a file. This should be the first tool to call when you want to understand a new file, unless you already know what you are looking for. Returns a JSON object containing info about top-level symbols in the file.

Inputs: relative_path (required), depth, max_answer_chars. Returns: result

initial_instructionsInitial InstructionsA
Read-only

Provides the 'Serena Instructions Manual', which contains essential information on how to use the Serena toolbox. IMPORTANT: If you have not yet read the manual, call this tool immediately after you are given your task by the user, as it will critically inform you!.

Inputs: no named parameters. Returns: result

insert_after_symbolInsert After SymbolA
Destructive

Inserts the given body/content after the end of the definition of the given symbol (via the symbol's location). A typical use case is to insert a new class, function, method, field or variable assignment.

Inputs: name_path (required), relative_path (required), body (required). Returns: result

insert_before_symbolInsert Before SymbolA
Destructive

Inserts the given content before the beginning of the definition of the given symbol (via the symbol's location). A typical use case is to insert a new class, function, method, field or variable assignment; or a new import statement before the first symbol in the file.

Inputs: name_path (required), relative_path (required), body (required). Returns: result

list_dirList DirA
Read-only

Lists files and directories in the given directory (optionally with recursion). Returns a JSON object with the names of directories and files within the given directory.

Inputs: relative_path (required), recursive (required), skip_ignored_files, max_answer_chars. Returns: result

list_memoriesList MemoriesA
Read-only

List available memories. Any memory can be read using the read_memory tool.

Inputs: no named parameters. Returns: result

onboardingOnboardingA
Read-only

Call this tool if onboarding was not performed yet. You will call this tool at most once per conversation. Returns instructions on how to create the onboarding information.

Inputs: no named parameters. Returns: result

prepare_for_new_conversationPrepare For New ConversationB
Read-only

Instructions for preparing for a new conversation. This tool should only be called on explicit user request.

Inputs: no named parameters. Returns: result

read_fileRead FileA
Read-only

Reads the given file or a chunk of it. Generally, symbolic operations like find_symbol or find_referencing_symbols should be preferred if you know which symbols you are looking for. Returns the full text of the file at the given relative path.

Inputs: relative_path (required), start_line, end_line, max_answer_chars. Returns: result

read_memoryRead MemoryA
Read-only

Read the content of a memory file. This tool should only be used if the information is relevant to the current task. You can infer whether the information is relevant from the memory file name. You should not read the same memory file multiple times in the same conversation.

Inputs: memory_file_name (required), max_answer_chars. Returns: result

rename_symbolRename SymbolA
Destructive

Renames the symbol with the given name_path to new_name throughout the entire codebase. Note: for languages with method overloading, like Java, name_path may have to include a method's signature to uniquely identify a method. Returns result summary indicating success or failure.

Inputs: name_path (required), relative_path (required), new_name (required). Returns: result

replace_contentReplace ContentA
Destructive

Replaces one or more occurrences of a given pattern in a file with new content.

This is the preferred way to replace content in a file whenever the symbol-level tools are not appropriate.

VERY IMPORTANT: The "regex" mode allows very large sections of code to be replaced without fully quoting them! Use a regex of the form "beginning.*?end-of-text-to-be-replaced" to be faster and more economical! ALWAYS try to use wildcards to avoid specifying the exact content to be replaced, especially if it spans several lines. Note that you cannot make mistakes, because if the regex should match multiple occurrences while you disabled allow_multiple_occurrences, an error will be returned, and you can retry with a revised regex. Therefore, using regex mode with suitable wildcards is usually the best choice!.

Inputs: relative_path (required), needle (required), repl (required), mode (required), +1 more. Returns: result

replace_symbol_bodyReplace Symbol BodyA
Destructive

Replaces the body of the symbol with the given name_path.

The tool shall be used to replace symbol bodies that have been previously retrieved (e.g. via find_symbol). IMPORTANT: Do not use this tool if you do not know what exactly constitutes the body of the symbol.

Inputs: name_path (required), relative_path (required), body (required). Returns: result

search_for_patternSearch For PatternA
Read-only

Offers a flexible search for arbitrary patterns in the codebase, including the possibility to search in non-code files. Generally, symbolic operations like find_symbol or find_referencing_symbols should be preferred if you know which symbols you are looking for.

Pattern Matching Logic: For each match, the returned result will contain the full lines where the substring pattern is found, as well as optionally some lines before and after it. The pattern will be compiled with DOTALL, meaning that the dot will match all characters including newlines. This also means that it never makes sense to have .* at the beginning or end of the pattern, but it may make sense to have it in the middle for complex patterns. If a pattern matches multiple lines, all those lines will be part of the match. Be careful to not use greedy quantifiers unnecessarily, it is usually better to use non-greedy quantifiers like .*? to avoid matching too much content.

File Selection Logic: The files in which the search is performed can be restricted very flexibly. Using restrict_search_to_code_files is useful if you are only interested in code symbols (i.e., those symbols that can be manipulated with symbolic tools like find_symbol). You can also restrict the search to a specific file or directory, and provide glob patterns to include or exclude certain files on top of that. The globs are matched against relative file paths from the project root (not to the relative_path parameter that is used to further restrict the search). Smartly combining the various restrictions allows you to perform very targeted searches. Returns A mapping of file paths to lists of matched consecutive lines.

Inputs: substring_pattern (required), context_lines_before, context_lines_after, paths_include_glob, +4 more. Returns: result

switch_modesSwitch ModesB
Read-only

Activates the desired modes, like ["editing", "interactive"] or ["planning", "one-shot"].

Inputs: modes (required). Returns: result

think_about_collected_informationThink About Collected InformationA
Read-only

Think about the collected information and whether it is sufficient and relevant. This tool should ALWAYS be called after you have completed a non-trivial sequence of searching steps like find_symbol, find_referencing_symbols, search_files_for_pattern, read_file, etc.

Inputs: no named parameters. Returns: result

think_about_task_adherenceThink About Task AdherenceA
Read-only

Think about the task at hand and whether you are still on track. Especially important if the conversation has been going on for a while and there has been a lot of back and forth.

This tool should ALWAYS be called before you insert, replace, or delete code.

Inputs: no named parameters. Returns: result

think_about_whether_you_are_doneThink About Whether You Are DoneA
Read-only

Whenever you feel that you are done with what the user has asked for, it is important to call this tool.

Inputs: no named parameters. Returns: result

write_memoryWrite MemoryA
Destructive

Write some information (utf-8-encoded) about this project that can be useful for future tasks to a memory in md format. The memory name should be meaningful.

Inputs: memory_file_name (required), content (required), max_answer_chars. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between search tools (find_symbol, find_referencing_symbols, search_for_pattern) and file operations (read_file vs. find_file vs. list_dir). The descriptions help clarify differences, but an agent might occasionally misselect between similar search or file access tools.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., activate_project, create_text_file, execute_shell_command) with only minor deviations like initial_instructions (adjective_noun) and think_about_* tools (verb_phrase). Overall, the pattern is predictable and readable.

    Tool Count3/5

    With 29 tools, the count feels heavy for a code assistant server, bordering on overwhelming. While many tools are specialized (e.g., multiple think_about_* tools), the high number could lead to confusion or inefficiency in tool selection.

    Completeness5/5

    The toolset provides comprehensive coverage for code editing and project management, including CRUD operations for files and symbols, search capabilities, memory management, and workflow guidance (e.g., onboarding, thinking tools). No obvious gaps are present for its intended domain.

    Maintenance

    ActivityActive
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      A coding agent toolkit that transforms LLMs into coding assistants capable of working directly on your codebase with semantic code retrieval and editing tools, providing IDE-like capabilities without requiring API subscriptions.
      33
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides semantic code intelligence tools (search, structural views) and a workspace TUI interface for LLM agents to efficiently navigate codebases, manage context, and maintain architectural patterns across Python, Java, C++, and Perl projects.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
      19
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides IDE-like coding capabilities for AI agents via MCP, enabling semantic code retrieval, symbol-level editing, refactoring, and navigation across many programming languages.
      MIT