Symbol-level MCP server for Claude Code. Returns symbols and outlines instead of whole files to cut input-token use, with AST-anchored edits and a local savings dashboard. Clean-room OSS.
A symbol-level MCP server for Claude Code, Codex, and OpenAI models. MOZCODE
returns the symbol you asked for instead of the whole file, so an agentic coding loop spends far fewer input
tokens. It parses source with tree-sitter, hands the model a function/class/method
(or a collapsed outline) rather than 400 lines of context, anchors edits to AST
spans so the model never re-reads a file after editing it, and meters the estimated
savings to a local dashboard.
Everything runs locally. There is no account, no proxy, and no server that
receives your code: the MCP server is a local stdio process.
Provenance. MOZCODE is a clean-room, open-source implementation designed from a
public technical teardown of WOZCODE (Woz, YC W25). No
WOZCODE source, assets, or branding are used. It reconstructs a well-known public
technique (tree-sitter AST extraction + a local MCP server) from first
principles. Not affiliated with Woz. MIT-licensed.
Why it saves tokens
In an agentic loop, the accumulated conversation is re-sent on every turn, so a
file read into context at turn 3 is paid for again at turns 4, 5, 6… until
compaction. Returning less text per tool call therefore compounds across the
session. MOZCODE attacks bytes-per-tool-call.
The tools
Tool
What it returns
code_read(path, symbol)
Just that function/class + a few context lines (default 3). No symbol: a collapsed-body outline of the file.
code_outline(path)
The AST skeleton: every symbol's signature + line span.
code_search(query)
Matches grouped by their enclosing symbol, not raw lines. Many grep hits collapse into the handful of functions that contain them. Optional path_glob.
code_edit(path, symbol, new_source)
Replaces a whole symbol in place, anchored to its AST span. Validates the file still parses. No re-read afterward.
db_schema(path | connection_env)
An entire SQLite or PostgreSQL schema in one metadata-only call: tables/views, columns, keys, and indexes.
moz_savings · moz_status · moz_dashboard
Estimated savings, server status, and the HTML dashboard (also exposed as slash commands, below).
Unsupported languages and parse errors degrade gracefully to a plain
(line-numbered) read, so a tool call never hard-fails.
Languages with real AST extraction: TypeScript, TSX, JavaScript, Python.
Anything else falls back to a plain read.
Databases: pass a SQLite path directly, or put a PostgreSQL URL in
DATABASE_URL (or another environment variable named via connection_env).
Credentials never need to appear in a model-visible tool argument.
Edits stay in the project:code_edit refuses paths outside the project
root (including ../ and symlinks that leave it); use the host's own Edit tool
there. Set MOZCODE_ALLOW_EDIT_OUTSIDE_PROJECT=1 in the server environment to
lift this. The read-only tools accept any path.
The plugin also ships two agents: moz-code, a coding agent that reads and edits by
symbol, and moz-explore, a read-only explorer that runs on Sonnet so broad scans stay
cheaper than the main model.
Install (local, no account)
git clone https://github.com/Malek1414/MOZCODE.git mozcode && cd mozcode
npm install
npm run build