Serena is a powerful coding agent toolkit with 7.4k stars that provides semantic retrieval and editing capabilities through an MCP server. It's the first fully-featured coding agent available as an MCP server without requiring API keys or subscriptions.
- Semantic Code Analysis: Uses language servers for symbolic understanding of code
- Multi-language Support: Python, JavaScript, TypeScript, Go, Rust, Java, C++, C#
- File Operations: Read, write, edit, and manage files with context awareness
- Memory System: Project-specific memory for context retention
- Web Dashboard: Real-time monitoring and statistics
- Log Window: Debugging and troubleshooting interface
- Security: Restricted file operations and shell command controls
Serena is automatically installed when you run:
./install-ai-tools.sh --non-interactiveFor enhanced setup with additional features:
./setup/setup-serena.shThe enhanced setup creates a comprehensive configuration at ~/.serena/serena_config.yml:
# Project configuration
project: ~/workspace
context: ide-assistant
# Language server configuration
language_server:
enabled: true
languages:
- python
- javascript
- typescript
- go
- rust
- java
- cpp
- csharp
# Web dashboard configuration
web_dashboard:
enabled: true
port: 8080
host: localhost
# Log window configuration
log_window:
enabled: true
port: 8081
host: localhost
# Memory configuration
memory:
enabled: true
max_memories: 100
# Security settings
security:
restrict_to_project: true
allow_shell_commands: false
max_file_size: 10485760 # 10MB
# Performance settings
performance:
max_parallel_files: 10
enable_caching: true
cache_timeout: 3600Initialize a project with Serena:
# Initialize current directory
serena-init
# Initialize specific project
serena-init my-project ~/projects/my-projectThis creates .serena/project.yml in your project directory.
# Start Serena with default project
serena
# Start with specific project and mode
serena ~/my-project development
# Start in debugging mode
serena ~/my-project debugging- default: Basic code analysis and file operations
- development: Full development tools including shell operations
- debugging: Enhanced debugging with language server operations
- Dashboard: http://localhost:8080 - Monitor tool usage and statistics
- Log Window: http://localhost:8081 - View logs and debug information
Serena provides 30+ tools for code analysis and manipulation:
find_symbol: Search for symbols in codebaseget_symbols_overview: Get overview of top-level symbolsfind_referencing_code_snippets: Find code that references a symbolfind_referencing_symbols: Find symbols that reference another symbol
read_file: Read file contentscreate_text_file: Create or overwrite filesinsert_at_line: Insert content at specific linereplace_lines: Replace line rangesdelete_lines: Delete line rangeslist_dir: List directory contents
write_memory: Store project-specific memoriesread_memory: Retrieve stored memorieslist_memories: List all project memoriesdelete_memory: Remove specific memories
activate_project: Switch between projectsget_active_project: Get current project infoonboarding: Initialize project structure analysischeck_onboarding_performed: Check if project is onboarded
execute_shell_command: Run shell commands (optional)restart_language_server: Restart language serverswitch_modes: Change operation modesget_current_config: View current configuration
think_about_collected_information: Analyze information completenessthink_about_task_adherence: Check if on track with taskthink_about_whether_you_are_done: Determine if task is complete
Serena supports multiple programming languages through language servers:
- Python: Full syntax analysis and refactoring
- JavaScript/TypeScript: ES6+ features and type checking
- Go: Static analysis and code navigation
- Rust: Ownership analysis and error checking
- Java: Class hierarchy and dependency analysis
- C++: Template analysis and symbol resolution
- C#: .NET framework integration
- Project Restriction: File operations limited to project directory
- Shell Command Control: Optional shell command execution
- File Size Limits: 10MB maximum file size for operations
- Extension Filtering: Only allowed file types can be modified
- Memory Limits: Configurable memory storage limits
- Parallel Processing: Up to 10 files processed simultaneously
- Response Caching: Language server responses cached for 1 hour
- Selective Analysis: Only analyze relevant file types
- Memory Management: Automatic cleanup of old memories
-
Language Server Not Working
# Restart language server claude "restart the language server"
-
File Operations Failing
- Check file permissions
- Ensure file is within project directory
- Verify file extension is allowed
-
Memory Issues
# Clear project memories claude "delete all memories for this project"
-
Web Dashboard Not Loading
- Check if port 8080 is available
- Verify firewall settings
- Restart Serena with different port
Enable debug mode for detailed logging:
serena ~/my-project debuggingCheck Serena logs:
tail -f ~/.serena/serena.log- ✅ No subscription required
- ✅ Works with any MCP client
- ✅ Symbolic code understanding
- ✅ Open-source and extensible
- ✅ No API costs
- ✅ No rate limits
- ✅ Works offline
- ✅ Full MCP integration
- ✅ Semantic code analysis
- ✅ Language server integration
- ✅ Memory system
- ✅ Web dashboard
Add custom language server configurations:
language_server:
custom_servers:
mylang:
command: mylang-lsp
args: ["--stdio"]
file_patterns: ["*.ml"]Configure memory retention:
memory:
enabled: true
max_memories: 100
retention_days: 30
auto_cleanup: trueOptimize for your system:
performance:
max_parallel_files: 20 # Increase for powerful systems
cache_timeout: 7200 # Longer cache for stability
memory_limit: 512 # MB limit for language servers- 📢 Follow @oraios on GitHub
- 💬 Join discussions on GitHub Issues
- 🌟 Star the repository if you find it useful