Code Navigation

mur code-nav setup gives an agent structural code search (ast-grep) and, if you ask for it, LSP-backed symbol lookup through serena: definitions, references and hover. Everything it installs lives under ~/.mur/tools/, and the agent's sandbox is granted exec only there.

mur code-nav setup --agent coach                                     # ast-grep only
mur code-nav setup --agent coach --with-serena --project ~/src/app   # add serena for one repo
mur code-nav setup --agent coach --with-serena --project ~/src/api --entry api

setup prints what it will install, grant and enable, then waits for you to type yes. Pass --yes to confirm the printed plan without a prompt; flags decide what the plan contains, --yes never adds to it. A re-run only asks about what changed since the last successful setup. If setup fails partway, nothing is recorded, so the next run asks again about everything, including steps that already succeeded.

Smoke launch

With --with-serena, setup ends by starting each enabled language server under the agent's sandbox and checking that it answers one initialize. Without --with-serena, no server is started and nothing is smoke-tested.

Only the servers MUR installs itself are launched:

LanguageServer MUR installs
pythonpyright
phpintelephense, run as node <entry .js>
typescripttypescript-language-server (plus a pinned typescript), run as node <entry .mjs>

serena downloads every other server itself on first start, so there is nothing on disk to launch yet. Those are listed as Β· not launched.

Each launched server prints one line:

Smoke launch under agent 'coach''s sandbox:
  βœ“ php: initialize answered
  ? typescript: not verified β€” …
  βœ— python: …

βœ“ means the server answered. βœ— means the server failed to start. ? means the launch could not be verified, for example because setup ran from an already-sandboxed shell. Either a βœ— or a ? fails setup: only a run where every launched server answered counts as passing. The smoke launch runs after the installs and grants are recorded, so a failed launch keeps them; fix the lines marked βœ— or ? and re-run setup.

One serena entry per repository

Each serena entry gets its own SERENA_HOME. Two serena processes sharing one home race on its project registry and drop a registration, so a second repo needs a second entry:

mur code-nav setup --agent coach --with-serena --project ~/src/api --entry api
Entry nameSERENA_HOME
serena (the default)<agent home>/serena
anything else<agent home>/serena-homes/<name>

The agent's tools are named after the entry, so a second entry's tools never overwrite the first's.

Several agents and repos at once

mur code-nav setup --wizard pm qa                       # pick projects, confirm once, offer a restart
mur code-nav setup --wizard pm qa --path ~/src/tools    # add a directory that is not indexed
mur code-nav setup --wizard pm qa --yes --restart       # scripted: fixed selection, then restart

--wizard takes one or more agent names (case-insensitive) and sets them all up in one pass:

  1. Pick projects. One multi-select over mur project list, shared by every named agent. A project every agent already serves starts ticked; one only some agents serve is labelled (served by pm (qa not selected)) and left unticked, so pressing Enter never widens another agent's scope. Customize per agent? opens one list per agent. Add a path… (or --path <dir>, repeatable) takes any directory, indexed or not; the filesystem root, your home directory itself and anything under ~/.mur are refused. An unindexed path works for serena, and the plan says that mur project search won't cover it until you run mur project index <path>.
  2. Detect languages. Each project's languages come from its marker files (Cargo.toml, package.json, tsconfig.json, pyproject.toml, composer.json, go.mod, .vue, …). Languages are chosen once per project, not per agent. Lua, C/C++ and the high-risk servers (Rust, TypeScript, Go, …) are shown but stay off until you tick them. For a narrower set on one agent, run the printed single-agent command with --lsp-only.
  3. Name entries. A repo an agent already serves under some entry name reuses that entry, whatever it is called: renaming would change the tool prefix, and a second entry would split serena's index. An entry name already serving another repo is never repointed; the wizard proposes <name>-2 (or -3, …) and shows it. A serena entry with no record of which project it serves is asked about; under --yes that target fails and the others continue.
  4. One combined plan. Each target with its equivalent mur code-nav setup --agent … command, the shared installs (each tool once), the new grants per agent, the language servers per project, and a project Γ— agent matrix. One confirmation (or --yes) applies all of it. A second question comes only if installing turned up exec lanes the agents don't hold yet; declining writes no serena entry, lane grant or record for those targets, and a rerun asks again.
  5. Restart. After granting, the wizard offers to restart the running agents that changed, once each. An agent whose target failed to install, had lanes declined, or failed to commit is not restarted, and you get the reason and the exact mur agent restart <name> command; a smoke failure does not block the restart. Stopped agents stay stopped. --yes confirms the plan only; restarting non-interactively needs --restart.

Unticking a project never removes its entry: the plan lists it as left in place with the mur agent mcp remove <agent> <entry> command. A rerun with nothing new prints Nothing to do and asks nothing. One target's failure leaves the others' results and records intact and is reported per target; the exit code is non-zero if any target failed, or any restart did. In murmur, !mur code-nav setup --wizard … opens in the terminal so the pickers work; --yes keeps it inline.

Entry-name rules

--entry takes 1–64 characters of lower-case a-z, 0-9, _ and -. Two more rules exist because the name also becomes the tool prefix (mcp__<name>__*):

  • It must survive tool-name sanitizing unchanged. No trailing _ and no __. serena_ and repo__a are refused, because they would share a prefix with serena and repo_a.
  • It must not share a tool prefix with another MCP server on the agent. code_nav and code/nav both become mcp__code_nav__*, so one would silently replace the other's tools and a call could land on the wrong repository.

setup checks all of this before it installs or writes anything. A refusal leaves your profile, the serena home and the consent record exactly as they were.

Upgrading from a shared home

Before per-entry homes, every entry shared <agent home>/serena. If you set up a custom-named entry back then (say code-nav), the agent now looks for serena-homes/code-nav, which was never created. Starting the agent fails with the exact line to run:

MCP server `code-nav` (kind: serena): its SERENA_HOME is now `…/serena-homes/code-nav`,
but only the older shared home `…/serena` exists … Re-run setup to create the entry's
own home: `mur code-nav setup --agent coach --with-serena --project '/path/to/repo' --entry code-nav`

Run it. Nothing is migrated: serena's config embeds absolute paths and an auth secret, and setup regenerates both. Names that were accepted before but break the rules above (a trailing _, for example) are now refused; give those entries a new name.

Checking a setup later

setup records what it installed and granted. doctor reads that record back and checks it still matches reality:

mur code-nav doctor                 # every agent that has run setup
mur code-nav doctor --agent coach
CheckWarns when
InstallsA recorded tool is missing from ~/.mur/tools/, or isn't the version this MUR pins
GrantsA grant setup recorded is gone from the agent's profile, or its path no longer exists
Manual grantsThe profile has a code-nav path setup never recorded, such as a hand-added spawn-dir into serena-homes/, or any grant on the shared ~/.npm cache
LanguagesAn entry's project.yml lists different languages from the ones setup wrote

Each warning prints the exact mur agent perm … or mur code-nav setup … line that fixes it. doctor is offline and read-only: it never installs, grants or rewrites anything. A missing record means setup has not run; a corrupt one is reported as an error, never as "nothing set up".

Choosing language servers

mur code-nav setup --agent coach --with-serena --project ~/src/app --lsp rust              # add Rust
mur code-nav setup --agent coach --with-serena --project ~/src/app --lsp-only python --lsp-only php   # exactly these two

--lsp <lang> only ever adds to an entry's languages. --lsp-only <lang> (repeatable) sets them to exactly that list, dropping any the entry listed before, and rewrites both the entry's project.yml and MUR's record from the same list. Use it to remove a language whose server won't start. Setup prints the languages it dropped.

--lsp-only refuses rather than guessing:

  • If a listed language's prerequisite is not on PATH, setup stops before writing anything. Install the prerequisite, or leave that language out.
  • It needs at least one language, and it cannot be combined with --lsp.

When project.yml lists fewer languages than MUR recorded, usually because a language was removed by hand after its server failed, mur code-nav doctor suggests an --lsp-only command that narrows the record to what the file lists, rather than re-adding the language that stopped serena.

The setup tip in murmur

When murmur starts in a code workspace and the agent has never run mur code-nav setup, it shows a one-time tip. A code workspace is any directory where walking up from the working directory finds a project marker: .git, Cargo.toml, package.json, go.mod, pyproject.toml, setup.py, pom.xml, build.gradle, Gemfile, composer.json, Package.swift, CMakeLists.txt, mix.exs or deno.json. The tip puts this command on a Tab chip:

mur code-nav setup --yes --agent <agent> --with-serena --project <repo root>

Nothing runs until you review the line and send it. The check looks at where you are working, not at the words in your prompt, so it behaves the same whatever language you write in.

The bundled mur-search skill uses the same check, so its search guidance loads in code workspaces and stays out of other sessions. Your own skills can do the same with a session_start trigger:

triggers:
  - type: session_start
    workspace_markers: [.git, Cargo.toml, package.json]

Without workspace_markers, a session_start trigger fires in every session. Older runtimes ignore the field and load the skill everywhere.

What stays locked down

  • Serena's config is checked before every launch, so a repository cannot swap in its own language server.
  • The binary the runtime executes is hash-pinned at setup. See MCP Binary Pinning.
  • High-risk language servers (Rust, TypeScript, Go, …) stay off unless you name them with --lsp <lang>.