Serena is a powerful MCP (Model Context Protocol) server that transforms any LLM into a coding agent with semantic code understanding. It provides symbolic code retrieval and editing capabilities, working directly within your codebase like an IDE would.
Run Serena directly from the repository without local installation:
uvx --from git+https://github.com/oraios/serena serena start-mcp-server
Clone the repository and navigate to it:
git clone https://github.com/oraios/serena
cd serena
Optionally edit the configuration file:
uv run serena config edit
Run the server:
uv run serena start-mcp-server
docker run --rm -i --network host -v /path/to/your/projects:/workspaces/projects ghcr.io/oraios/serena:latest serena start-mcp-server --transport stdio
nix run github:oraios/serena -- start-mcp-server --transport stdio
Serena can be configured in several ways:
~/.serena/serena_config.yml
start-mcp-server
.serena/project.yml
Generate a project configuration with:
uvx --from git+https://github.com/oraios/serena serena project generate-yml
Activate a project by providing a path or name:
# In your client, ask the LLM:
# "Activate the project /path/to/my_project"
# or
# "Activate the project my_project"
For larger projects, index them first to improve performance:
uvx --from git+https://github.com/oraios/serena serena project index
claude mcp add serena -- uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --project $(pwd)
Add to ~/.codex/config.toml
:
[mcp_servers.serena]
command = "uvx"
args = ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "codex"]
Then in Codex, ask to "Activate the current dir as project using serena"
Edit claude_desktop_config.json
and add:
{
"mcpServers": {
"serena": {
"command": "/abs/path/to/uvx",
"args": ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server"]
}
}
}
Serena uses contexts and modes to customize behavior:
Contexts (set at startup, cannot be changed):
desktop-app
: For desktop applications (default)agent
: For autonomous agent scenarioside-assistant
: For IDE integrationsModes (can be changed during a session):
planning
: For planning and analysisediting
: For code modificationinteractive
: For conversational interactionone-shot
: For tasks completed in a single responseSet context at startup:
serena start-mcp-server --context ide-assistant
Set modes at startup:
serena start-mcp-server --mode planning --mode no-onboarding
Serena stores project-specific memories in .serena/memories/
that help it understand your project across sessions. These can be manually edited or extended.
For best results:
git config core.autocrlf true
http://localhost:24282/dashboard/index.html
Serena provides numerous tools including:
activate_project
: Activates a projectfind_symbol
: Searches for code symbolsfind_referencing_symbols
: Finds symbol referencesinsert_after_symbol
, insert_before_symbol
: Modify code at the symbol levelexecute_shell_command
: Runs shell commandsread_file
, create_text_file
: File operationsread_memory
, write_memory
: Memory managementThe full set of tools enables sophisticated code navigation, analysis, and editing capabilities that make any LLM more effective at working with your codebase.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "serena" '{"command":"uvx","args":["--from","git+https://github.com/oraios/serena","serena-mcp-server"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"serena": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/oraios/serena",
"serena-mcp-server"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"serena": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/oraios/serena",
"serena-mcp-server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect