About Serena

  • Serena is a powerful coding agent toolkit capable of turning an Large Language Models (LLMs) into a fully-featured agent that works directly on your codebase. Unlike most other tools, it is not tied to an LLM, framework or an interface, making it easy to use it in a variety of ways.
  • Serena provides essential semantic code retrieval and editing tools that are akin to an IDE’s capabilities, extracting code entities at the symbol level and exploiting relational structure. When combined with an existing coding agent, these tools greatly enhance (token) efficiency.
  • Serena is free & open-source, enhancing the capabilities of LLMs you already have access to free of charge.

How to use Serena with codex cli

  1. Install Codex CLI (skip if already installed)

  2. UV Installation (Serena is managed by uv; uvx runs Serena without a permanent install)

  3. Configure Serena as an MCP server for Codex Create (or edit) ~/.codex/config.toml and add:

    [mcp_servers.serena]
    command = "uvx"
    args = ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "codex"]
  4. Start Codex from inside your project directory

    cd /path/to/your/project
    codex
  5. Activate the project inside the Codex chat (required) Say:

    • Activate the current dir as project using serena
  6. Verify / troubleshoot

    • If something fails, check Codex logs: ~/.codex/log/codex-tui.log
    • If Serena’s dashboard doesn’t auto-open, open it manually:
    • Codex may show Serena tool calls as failed even when they actually ran (known Codex UI issue).
  7. If Serena can’t “see” your code well: install language servers for your language Serena’s semantic code understanding relies on language servers (LSP) unless you use the JetBrains backend. See: https://oraios.github.io/serena/01-about/020_programming-languages.html

Reference List

  1. https://github.com/oraios/serena
  2. https://oraios.github.io/serena/02-usage/030_clients.html
  3. https://oraios.github.io/serena/01-about/000_intro.html