Serena — Semantic Code Agent via MCP
Serena is a coding agent MCP server with semantic code retrieval and editing. 22K+ stars. Understands classes, functions, symbols for precise context-aware edits. MIT.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install 5c63d696-1d73-4e33-994a-8d7d7151c640 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
Serena is a coding agent that operates as an MCP (Model Context Protocol) server, providing semantic code retrieval and editing capabilities. It understands your codebase at the symbol level: classes, functions, methods, and their relationships.
Serena targets developers using AI coding assistants who want more precise code understanding than simple text search. By leveraging language server protocol data, Serena provides context-aware edits that respect your code's semantic structure.
The project is actively maintained and suitable for both individual developers and teams looking to integrate it into their existing toolchain. Documentation and community support are available for onboarding.
How it saves time or tokens
Traditional code search finds text matches. Serena finds semantic matches: all callers of a function, all implementations of an interface, all subclasses of a base class. This precision means your AI assistant gets exactly the right context for edits, reducing token waste from irrelevant search results. The estimated token budget is around 450 tokens per query.
How to use
- Install Serena as an MCP server in your AI coding assistant's configuration.
- Point Serena at your project directory so it can index the codebase.
- Use your AI assistant normally. Serena provides semantic code context through MCP tools.
- Ask for refactoring, analysis, or edits that require understanding code relationships.
Example
{
"mcpServers": {
"serena": {
"command": "uvx",
"args": ["serena", "--workspace", "/path/to/project"],
"env": {}
}
}
}
# Install and run Serena
pip install serena
serena --workspace /path/to/your/project
# Serena exposes MCP tools like:
# - find_symbol: find definition of a class/function
# - find_references: find all usages of a symbol
# - semantic_edit: edit code with symbol awareness
# - get_context: retrieve semantic context for a code location
Related on TokRepo
- AI Tools for Coding — AI coding assistants and development tools.
- MCP Integrations — Browse MCP server integrations for development workflows.
Common pitfalls
- Running Serena on a very large monorepo without filtering. Indexing the entire repository takes time and memory. Limit the workspace to the relevant subdirectory.
- Expecting full language support from day one. Serena works best with Python, TypeScript, and Go. Support for other languages depends on the underlying language server availability.
- Not restarting Serena after major code changes. The index can become stale. Restart the MCP server or trigger a re-index after large refactors.
- Running the workflow in a restricted environment without verifying permissions. Missing file system or network access causes silent failures that are hard to diagnose.
Preguntas frecuentes
MCP is a protocol that allows AI assistants to interact with external tools and data sources. Serena implements an MCP server that provides semantic code understanding as tools that the AI assistant can call.
Serena provides strong support for Python, TypeScript, JavaScript, and Go. Additional language support depends on available language servers. Check the Serena documentation for the current language compatibility matrix.
Yes. Serena is designed to work as an MCP server with Claude Code and other AI coding assistants that support the MCP protocol. Add Serena to your MCP server configuration to enable it.
Regular search finds text matches. Serena understands code structure: it can find all callers of a function, all implementations of an interface, or all places where a type is used. This semantic understanding enables more precise code navigation and refactoring.
Yes. Serena is open-source under the MIT license. The project accepts community contributions for additional language server integrations and new MCP tools.
Referencias (3)
- Serena GitHub— Semantic code agent via MCP with symbol-level understanding
- MCP Specification— MCP protocol for AI tool integration
- LSP Specification— Language Server Protocol for code intelligence
Relacionados en TokRepo
Fuente y agradecimientos
- GitHub: https://github.com/oraios/serena (22K+ stars)
- License: MIT
- Docs: https://serena.dev
Discusión
Activos relacionados
Context+ — Semantic Code Intelligence MCP Server
MCP server combining RAG, Tree-sitter AST parsing, and spectral clustering to turn large codebases into searchable feature graphs. 99% accuracy on monorepos. 1,700+ GitHub stars.
Claude Context — Semantic Code Search MCP
Claude Context is an MCP server for semantic code search, so agents can retrieve relevant code without stuffing whole folders into the prompt.
Codebase Memory MCP — Code Knowledge Graph Server
High-performance MCP server that indexes codebases into persistent knowledge graphs. Supports 66 languages, sub-millisecond queries, and claims 99% fewer tokens than raw file context. 1,100+ stars.
WhatsApp MCP Server — Chat with WhatsApp via AI Agents
MCP server connecting Claude and AI agents to your personal WhatsApp. Search contacts, read messages, send replies and media via natural language.