Serena is a powerful coding agent toolkit that transforms any LLM into a comprehensive agent capable of working directly with your codebase. It provides semantic code retrieval and editing tools similar to an IDE, allowing LLMs to efficiently find and modify code at the symbol level rather than working with entire files or basic string replacements.
Serena requires uv for package management. If you don't already have it installed, follow these steps:
# Install uv from the official documentation
# Visit https://docs.astral.sh/uv/getting-started/installation/ for instructions
The quickest way to get Serena running is to start the MCP (Model Context Protocol) server directly from GitHub:
uvx --from git+https://github.com/oraios/serena serena start-mcp-server --help
This command will display all available options for configuring the MCP server.
To use Serena with your preferred LLM client, you'll need to configure the client to connect to the Serena MCP server. The configuration varies depending on which client you're using:
Serena integrates with a wide range of LLM clients through the Model Context Protocol (MCP):
If your preferred client doesn't support MCP directly, you can:
Serena leverages language servers through the Language Server Protocol (LSP) to provide semantic code analysis for over 30 programming languages, including:
Some languages may require additional dependencies to be installed for full functionality.
Serena operates best with a project-based approach:
Serena can be customized for your specific needs through various configuration options. The most important configurations include:
For detailed information about all available configuration options, refer to the user guide at https://oraios.github.io/serena/02-usage/050_configuration.html.
For optimal results with Serena:
Serena is particularly valuable for navigating and modifying complex, large codebases where its semantic understanding provides significant advantages over simpler file-based approaches.
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.json2. 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