Is the Serena MCP server safe? What it can reach
What the Serena MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Serena is an open-source coding toolkit from Oraios AI that gives an agent symbol-level code search and edits. It runs locally over stdio, with no sign-in. Its tools can edit files and execute_shell_command runs shell commands, and Serena’s own docs say only a sandbox fully contains that. You can exclude tools or set a project to read-only.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| oraios/serena | Official | active |
It runs as a local process on your machine.
How it signs in
No credential. Serena runs as your user on your machine and acts with your file and shell rights. It can also be started in streamable HTTP mode, which accepts localhost connections by default.
What its tools can do
| Kind | Tools |
|---|---|
| Read | read_file, list_dir, find_file, search_for_pattern, get_symbols_overview, find_symbol, find_referencing_symbols, find_implementations, find_declaration, get_diagnostics_for_file, read_memory, list_memories, get_current_config, initial_instructions, activate_project |
| Write | create_text_file, replace_content, replace_in_files, replace_lines, insert_at_line, replace_symbol_body, insert_after_symbol, insert_before_symbol, rename_symbol, write_memory, edit_memory, rename_memory, onboarding |
| Can’t be undone | execute_shell_command, delete_lines, safe_delete_symbol, delete_memory, remove_project |
Names are taken from the class names in src/serena/tools, which Serena converts to snake_case. Some tools are optional and off by default, and contexts such as claude-code switch many of them off. The JetBrains backend adds more tools (move, inline, debug and others) that are not listed here.
Built-in limits
| Option | What it does |
|---|---|
read_only (project setting) | In .serena/project.yml, read_only: true disables all editing tools. Serena says this is not effective with the REPL interface. |
excluded_tools | Removes named tools or tool markers, in global, context, mode or project configuration. With the tool interface, an excluded tool cannot be called. |
--context and --mode | Start-up options. Modes such as planning, no-memories and ext-readonly change which tools are on. |
trusted_project_path_patterns | Limits which project roots may trigger features such as running commands from repository-supplied settings. |
Docker sandbox | Serena’s security page names a container as the only full protection against unintended effects. |
The risks
- execute_shell_command runs any command as you, so an instruction hidden in a repository file or web page can run code, read secrets or push changes.
- Serena treats the repository, the client and your configuration as trusted, so a hostile repository is outside its security model.
- With the REPL interface the agent submits Python, so excluding a tool or setting read_only does not stop file changes made by that code.
- Memory tools write notes into the project and persist across sessions, so an injected note can steer later runs.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add serena -- serena start-mcp-server --context claude-code --project-from-cwdClaude Code names MCP tools mcp__serena__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:
{
"permissions": {
"deny": [
"mcp__serena__execute_shell_command",
"mcp__serena__remove_project",
"mcp__serena__delete_memory"
],
"ask": [
"mcp__serena__create_text_file",
"mcp__serena__replace_content",
"mcp__serena__replace_in_files",
"mcp__serena__replace_lines",
"mcp__serena__insert_at_line",
"mcp__serena__delete_lines",
"mcp__serena__replace_symbol_body",
"mcp__serena__rename_symbol",
"mcp__serena__safe_delete_symbol",
"mcp__serena__write_memory"
]
}
}Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.serena]
command = "serena"
args = ["start-mcp-server", "--context", "claude-code", "--project-from-cwd"]
disabled_tools = ["execute_shell_command", "remove_project", "delete_memory"]Checklist
- Set read_only: true in project.yml for exploration sessions.
- Exclude execute_shell_command if your client already has a shell tool.
- Keep the project under version control and commit before long edits.
- Run Serena in a container for repositories you do not trust.
- Keep HTTP mode on localhost.
Checked against the vendor documentation on November 25, 2026. oraios/serena README · Serena security considerations · Serena client setup (Claude Code) · Serena configuration (modes, excluded tools) · Serena tool classes · Serena file tools source · Serena symbol tools source · Serena memory tools source
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing