Skip to main content
Glama
  • :rocket: Serena is a powerful coding agent toolkit capable of turning an LLM into a fully-featured agent that works directly on your codebase. Unlike most other tools, it is not tied to an LLM, framework or an interface, making it easy to use it in a variety of ways.

  • :wrench: Serena provides essential semantic code retrieval and editing tools that are akin to an IDE's capabilities, extracting code entities at the symbol level and exploiting relational structure. When combined with an existing coding agent, these tools greatly enhance (token) efficiency.

  • :free: Serena is free & open-source, enhancing the capabilities of LLMs you already have access to free of charge.

You can think of Serena as providing IDE-like tools to your LLM/coding agent. With it, the agent no longer needs to read entire files, perform grep-like searches or basic string replacements to find the right parts of the code and to edit code. Instead, it can use code-centric tools like find_symbol, find_referencing_symbols and insert_after_symbol.

TIP

TheSerena JetBrains plugin has been released!

LLM Integration

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

In general, Serena can be integrated with an LLM in several ways:

  • by using the model context protocol (MCP). Serena provides an MCP server which integrates with

    • Claude Code and Claude Desktop,

    • terminal-based clients like Codex, Gemini-CLI, Qwen3-Coder, rovodev, OpenHands CLI and others,

    • IDEs like VSCode, Cursor or IntelliJ,

    • Extensions like Cline or Roo Code

    • Local clients like OpenWebUI, Jan, Agno and others

  • by using mcpo to connect it to ChatGPT or other clients that don't support MCP but do support tool calling via OpenAPI.

  • by incorporating Serena's tools into an agent framework of your choice, as illustrated here. Serena's tool implementation is decoupled from the framework-specific code and can thus easily be adapted to any agent framework.

Related MCP server: MCP Files

Serena in Action

Demonstration 1: Efficient Operation in Claude Code

A demonstration of Serena efficiently retrieving and editing code within Claude Code, thereby saving tokens and time. Efficient operations are not only useful for saving costs, but also for generally improving the generated code's quality. This effect may be less pronounced in very small projects, but often becomes of crucial importance in larger ones.

https://github.com/user-attachments/assets/ab78ebe0-f77d-43cc-879a-cc399efefd87

Demonstration 2: Serena in Claude Desktop

A demonstration of Serena implementing a small feature for itself (a better log GUI) with Claude Desktop. Note how Serena's tools enable Claude to find and edit the right symbols.

https://github.com/user-attachments/assets/6eaa9aa1-610d-4723-a2d6-bf1e487ba753

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, Serena 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.

  • The Serena JetBrains Plugin, which leverages the powerful code analysis and editing capabilities of your JetBrains IDE.

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 (like Serena) or at least freely available for use.

With Serena's LSP library, we provide support for over 30 programming languages, including AL, Bash, C#, C/C++, Clojure, Dart, Elixir, Elm, Erlang, Fortran, Go, Groovy (partial support), Haskell, Java, Javascript, Julia, Kotlin, Lua, Markdown, MATLAB, Nix, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Scala, Swift, TOML, TypeScript, YAML, and Zig.

IMPORTANT

Some language servers require additional dependencies to be installed; see theLanguage Support page for details.

The Serena JetBrains Plugin

As an alternative to language servers, the Serena JetBrains Plugin 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, CLion, and others. Only Rider is not supported.

The plugin offers the most robust and most powerful Serena experience.
See our documentation page for further details and instructions.

Quick Start

Prerequisites. Serena is managed by uv. If you don’t already have it, you need to install uv before proceeding.

Starting the MCP Server. The easiest way to start the Serena MCP server is by running the latest version from GitHub using uvx. Issue this command to see available options:

uvx --from git+https://github.com/oraios/serena serena start-mcp-server --help

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.

Community Feedback

Most users report that Serena has strong positive effects on the results of their coding agents, even when used within very capable agents like Claude Code. Serena is often described to be a game changer, providing an enormous productivity boost.

Serena excels at navigating and manipulating complex codebases, providing tools that support precise code retrieval and editing in the presence of large, strongly structured codebases. However, when dealing with tasks that involve only very few/small files, you may not benefit from including Serena on top of your existing coding agent. In particular, when writing code from scratch, Serena will not provide much value initially, as the more complex structures that Serena handles more gracefully than simplistic, file-based approaches are yet to be created.

Several videos and blog posts have talked about Serena:

Acknowledgements

Sponsors

We are very grateful to our sponsors who help us drive Serena's development. The core team (the founders of Oraios AI) put in a lot of work in order to turn Serena into a useful open source project. So far, there is no business model behind this project, and sponsors are our only source of income from it.

Sponsors help us dedicating more time to the project, managing contributions, and working on larger features (like better tooling based on more advanced LSP features, VSCode integration, debugging via the DAP, and several others). If you find this project useful to your work, or would like to accelerate the development of Serena, consider becoming a sponsor.

We are proud to announce that the Visual Studio Code team, together with Microsoft’s Open Source Programs Office and GitHub Open Source have decided to sponsor Serena with a one-time contribution!

Community Contributions

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.

Technologies

We built Serena on top of multiple existing open-source technologies, the most important ones being:

  1. multilspy. A library which wraps language server implementations and adapts them for interaction via Python. It provided the basis for our library Solid-LSP (src/solidlsp). Solid-LSP provides pure synchronous LSP calls and extends the original library with the symbolic logic that Serena required.

  2. Python MCP SDK

  3. All the language servers that we use through Solid-LSP.

Without these projects, Serena would not have been possible (or would have been significantly more difficult to build).

Customizing and Extending Serena

It is straightforward to extend Serena's AI functionality with your own ideas. Simply implement a new tool by subclassing serena.agent.Tool and implement the apply method with a signature that matches the tool's requirements. Once implemented, SerenaAgent will automatically have access to the new tool.

It is also relatively straightforward to add support for a new programming language.

We look forward to seeing what the community will come up with! For details on contributing, see contributing guidelines.

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.9/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between find_symbol, get_symbols_overview, and search_for_pattern, which could cause confusion about when to use each. The descriptions help clarify, but an agent might still hesitate between these for certain tasks.

    Naming Consistency5/5

    Tool names consistently follow a verb_noun pattern (e.g., activate_project, create_text_file, execute_shell_command) with clear and descriptive verbs. There are no deviations in style, making it easy to predict tool names and their functions.

    Tool Count3/5

    With 29 tools, the count feels heavy for a code assistant server, as it includes many overlapping or specialized tools (e.g., multiple 'think_about' tools). This could overwhelm agents and lead to inefficiency, though it's not extreme.

    Completeness5/5

    The tool set provides comprehensive coverage for code editing, file management, symbol manipulation, memory handling, and project onboarding. It includes all necessary CRUD operations and lifecycle steps, with no obvious gaps for the domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    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
      A
      quality
      Not graded
      maintenance
      Enables agents to quickly find and edit code in a codebase with surgical precision. Find symbols, edit them everywhere with tools for reading code blocks, searching/replacing text, and making precise line-based modifications.
      3
      11 npm
      -
    • 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
      D
      maintenance
      Enables AI coding agents to query a pre-built semantic knowledge graph of code, reducing token usage and tool calls. Supports 16 tools for code exploration, analysis, and context building.
      24 npm
      9
      MIT