The Serena MCP Server provides powerful tools for code analysis and editing through a protocol that integrates with various AI assistants. This article covers how to install and use this server to enhance your coding workflow.
Serena turns large language models into effective coding agents by providing semantic code retrieval and editing capabilities. When connected to tools like Claude Desktop, Claude Code, or other MCP-compatible clients, it enables AI assistants to understand and manipulate code at a symbolic level.
Clone the repository and navigate to it:
git clone https://github.com/oraios/serena
cd serena
Optionally create a configuration file:
mkdir ~/.serena
cp src/serena/resources/serena_config.template.yml ~/.serena/serena_config.yml
Run the server using uv
:
uv run serena-mcp-server
For a quick installation-free approach:
On Windows:
uvx --from git+https://github.com/oraios/serena serena-mcp-server.exe
On other operating systems:
uvx --from git+https://github.com/oraios/serena serena-mcp-server
docker run --rm -i --network host -v /path/to/your/projects:/workspaces/projects ghcr.io/oraios/serena:latest serena-mcp-server --transport stdio
{
"mcpServers": {
"serena": {
"command": "/abs/path/to/uvx",
"args": ["--from", "git+https://github.com/oraios/serena", "serena-mcp-server"]
}
}
}
From your project directory, run:
claude mcp add serena -- uvx --from git+https://github.com/oraios/serena serena-mcp-server --context ide-assistant --project $(pwd)
Then in Claude Code, ask to "read Serena's initial instructions" or run /mcp__serena__initial_instructions
to load the instruction text.
If you prefer HTTP-based communication:
uv run serena-mcp-server --transport sse --port 9121
Configure your client to connect to http://localhost:9121/sse
.
To start working with a project:
Ask the AI to activate your project by providing a path:
For larger projects, index your project to improve performance:
uv run --directory /abs/path/to/serena index-project
http://localhost:24282/dashboard/index.html
Serena's behavior can be customized through:
~/.serena/serena_config.yml
file.serena/project.yml
filesSerena works best with well-structured code and can significantly enhance your coding workflow by enabling AI assistants to understand and modify your codebase with greater precision.
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