← All posts

AI tool reviews › MCP servers

What is Serena? A semantic code MCP server for coding agents

Serena is an MCP server that gives coding agents symbol-level code search and edits through language servers. How it works, what it costs, and a rename test.

If you’ve browsed the MCP servers people add to their coding agents, or the plugin list inside Claude Code, you’ve probably seen the name Serena a few times. Its README calls it “the IDE for your coding agent,” but that alone may not tell you what actually changes once you connect it.

Serena is an MCP server that gives an agent tools for finding and editing code by symbol, such as functions and classes and the places that reference them, instead of by line numbers or text search. MCP is the open standard AI apps use to plug in outside tools, so one Serena server can work with Claude Code, Codex, Cursor, and others. It’s built by Oraios AI, and its GitHub repository was created on March 23, 2025. As of October 28, 2026, it has 30,789 stars, and Claude Code’s official plugin list counts 89,689 unique installs (as of October 16), 25th of 315 plugins. On top of that, version 2.0.0 brought a new interface and a new license on October 13, so older guides may not match what you install today.

How Serena reads code through a language server

A language server is a program that analyzes code in one language and answers questions like “where is this defined?” and “who uses this?” Editors talk to it through the Language Server Protocol (LSP). Serena starts a language server for each project, asks it the same questions, and hands the answers to the agent as tools. For Python it uses Pyright by default, it supports more than 40 languages, and a paid JetBrains plugin can serve as the backend instead.

When I started it with the claude-code context, it offered 21 tools. find_symbol and find_referencing_symbols look up symbols and references, tools such as rename_symbol and replace_symbol_body handle edits, and there are memory tools too. File reading and shell tools, which Claude Code already has, are left out. Version 2 also added a REPL interface with just two tools, one of which, serena_repl, runs Python code that calls Serena through an object named s. The Tools and APIs page counts bundling several operations into one call as an advantage, and although new configurations use it by default, the page still labels it beta.

What always sits in the context is small. Serena’s server instructions are one 130-character sentence asking the agent to read the manual through initial_instructions, and with tool search, Claude Code loads only tool names and server instructions at the start. That’s why the first request in my runs grew only from 20,733 tokens to at most 21,275. The cost arrives once the agent starts using Serena. By my tiktoken estimate, the 21 tool definitions come to about 6,500 tokens (about 1,000 for the REPL), and the manual is about 2,000.

Asking Serena who uses a function

To see the difference, I made a small Python project with five code files. parse_price in shop/pricing.py turns “$1,299.50” into cents, and cart.py, report.py, and the tests use it. I also planted an unrelated function with the same name, parse_price, in shop/legacy.py, so grep -n parse_price returns nine lines that mix the two. That’s why I asked Serena instead, through the official MCP Python SDK, the way Claude Code would. I ran it from inside the project with python ../refs.py 2>/dev/null, where the last part hides Serena’s logs.

import asyncio
import json

from mcp import Client, StdioServerParameters

# Start Serena over stdio for the project in this folder, as Claude Code does.
server = StdioServerParameters(command="serena", args=[
    "start-mcp-server", "--context", "claude-code", "--project-from-cwd", "--agent-interface", "tools"])


async def main() -> None:
    async with Client(server) as client:
        for path in ("shop/pricing.py", "shop/legacy.py"):
            result = await client.call_tool(
                "find_referencing_symbols", {"name_path": "parse_price", "relative_path": path})
            print(f"parse_price in {path} is used by:")
            for file, kinds in json.loads(result.content[0].text).items():
                for kind, symbols in kinds.items():
                    print(f"  {file}  {kind}: {', '.join(s['name_path'] for s in symbols)}")


asyncio.run(main())
parse_price in shop/pricing.py is used by:
  test_shop.py  File: test_shop
  test_shop.py  Method: ShopTest/test_parse_price
  shop/cart.py  File: cart
  shop/cart.py  Method: Cart/add
  shop/report.py  Variable: summarize/total
parse_price in shop/legacy.py is used by:
  shop/legacy.py  Function: load_rows

The two functions came apart cleanly. An import at the top of a file shows up as the file itself (File), and test_parse_price is listed because its body calls the function.

The same rename, with and without Serena

Next, I asked Claude Code to rename this function and run the tests. For Serena, I moved the settings the docs give for claude mcp add into a JSON file.

{
  "mcpServers": {
    "serena": {
      "command": "serena",
      "args": ["start-mcp-server", "--context", "claude-code", "--project-from-cwd"]
    }
  }
}
claude -p "Rename the function parse_price in shop/pricing.py to price_to_cents and update every place that uses it. Leave everything else as it is. Then run python3 -m unittest to check that the tests pass." \
  --model haiku --allowedTools "Read,Edit,Grep,Glob,Bash(python3 -m unittest*),mcp__serena" \
  --output-format stream-json --verbose --mcp-config ../serena.json < /dev/null > run.jsonl

The runs without Serena simply drop --mcp-config, and every run started from a fresh copy of the project. When I ran these, I also added --setting-sources local --strict-mcp-config to keep personal settings and other MCP servers out, and serena was a small wrapper that kept its data folders inside the test folder.

In the first run, though, Haiku never called Serena at all, and with 11 calls and $0.0056 it looked much like a run without it. Serena’s Claude Code setup page warns that because Claude Code loads tools on demand, Serena often goes unused, and it strongly recommends hooks. A hook is a command Claude Code runs at set moments, such as session start or just before a tool call. The documented hooks tell the agent to read the manual at the start and block one call when it keeps searching or reading without Serena. With those hooks added through --settings and "--agent-interface", "tools" added to args, a run pulled from the stream-json log looks like this.

model: claude-haiku-5-5 | claude code: 2.1.304
mcp servers: serena=connected
 1. Grep parse_price
 2. ToolSearch select:mcp__serena__initial_instructions,mcp__serena__rename_s
 3. serena:initial_instructions {}
 4. serena:rename_symbol {"name_path": "parse_price", "relative_path": "shop/pricing.py
 5. Grep parse_price|price_to_cents
 6. Bash python3 -m unittest 2>&1 | tail -n 20
turns: 7, tool calls: 6, time: 11.4s
tokens: input 10, cache write 13903, cache read 108051, output 1508
cost: $0.0048

The six Edit calls a run without Serena needed became one rename_symbol call, and with the REPL it was a single line, s.lsp.rename_symbol(...). Here’s what two runs of each setup looked like (costs as reported by Claude Code).

Setup (runs) Tool calls Cost (USD)
Without Serena (2) 11, 15 0.0056, 0.0058
Serena with hooks, REPL (2) 8, 11 0.0059, 0.0068
Serena with hooks, tools (2) 6, 12 0.0048, 0.0065

All seven runs passed the tests and left legacy.py alone. Still, the numbers swung within the same setup. The rename shrank to one call, but loading the tools and reading the manual added steps, and in the second runs Haiku read files one by one until a hook blocked it. Times ranged from 15.9 to 19.7 seconds without Serena and from 11.4 to 20.3 seconds with it. One difference was clear, though: all four runs that renamed through Serena kept the test method name test_parse_price, while the three that edited text changed it to test_price_to_cents as well. The tests passed either way, but the language server changed only real references. This was a small experiment with one model and five files, so please don’t read it as a benchmark.

In Oraios’s own evaluation, an agent does about 20 tasks both ways and judges the difference itself, and Claude Code (Opus 4.6) says cross-file renames that would take 8 to 12 steps collapse into one call. Of course, the same page also says built-in tools remain the better choice for small edits.

How it differs from Grep, Read, and LSP plugins

Claude Code’s Grep finds text and Edit replaces exact strings, so when names collide, the model has to read the code and decide which matches are right. Anthropic’s code intelligence plugins connect a language server too, and pyright-lsp for Python gives Claude diagnostics after edits plus an LSP tool for finding definitions and references. That tool is read-only, though, so edits still go through Edit, and Serena adds symbol-level editing and renaming on top. I didn’t run the LSP plugin here, so this comparison is based on the docs.

Where it fits, and what you take on

Serena is most likely to pay off in large codebases where the same names are scattered around, when you rename something or want to see what a change will touch before making it. In a small project where the agent can read every file quickly, though, the gain is small and the cost may even go up.

Installing it isn’t light, either. It needs uv and Python 3.13, and in my test folder the package and its dependencies took 164 MB, with another 31 MB for Pyright. Config and logs live in ~/.serena, and a symbol cache and memories go into each project’s .serena folder. According to its privacy policy, Serena sends anonymous data such as its version and operating system on every start, which you can turn off with SERENA_USAGE_REPORTING=false. It also opens a web dashboard in your browser by default, which I turned off in the config for these tests.

Permissions need extra care with the REPL. The security page says the code an agent submits can do anything the Serena process can do, so allowing mcp__serena with the REPL is close to allowing code execution. That’s why the docs recommend a sandbox. Since v2 the license is GPL-3.0-or-later, while the bundled SolidLSP library and earlier releases stay under MIT (license). The latest release is v2.1.0, from October 19. The README also asks people not to install Serena through marketplaces because their launch commands are outdated, and indeed the marketplace entry starts Serena in its default context, with no --context.

Installing it and a first thing to try

Following the installation guide, install uv first and then run the commands below. The last line adds Serena only for the project in the current folder; to use it everywhere, swap --project for --scope user and --project-from-cwd.

uv tool install -p 3.13 serena-agent
serena init
claude mcp add serena -- serena start-mcp-server --context claude-code --project "$(pwd)"

In my runs, the agent only called Serena after I added the hooks, so I’d add the ones from the setup page as well. To remove it, run claude mcp remove serena and uv tool uninstall serena-agent, then delete ~/.serena and the project’s .serena. A good first test is to pick a function whose name appears in more than one place and compare what grep finds with what find_referencing_symbols returns. I ran everything here on October 28, 2026, with Serena 2.1.0, Claude Code 2.1.304, and Haiku (claude-haiku-5-5).

AI tools helped with the research for this post.