Listed from the MCP registry; nobody on Odel publishes it.

MCP server: One MCP server.

Aptu Coder

@clouatre-labsMCP server · External

MCP server for code structure analysis using tree-sitter.

Code searchv0.47.0Apache-2.0Rust
Freeno charge per call

Runs on your machine from its package; the steps are below.

What it does

  1. Reads
  2. Writes
  3. High impact

At most: moves money, runs code or commands, deletes data, or sends messages for you.

What it costs

Free

Odel charges nothing per call. The publisher may charge for its own service.

Runs locally over stdio

This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).

MCP Bundlehttps://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-aarch64-apple-darwin.mcpb

Distributed as an MCP bundle (`https://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-aarch64-apple-darwin.mcpb`) — download it and import the bundle in your MCP client.

MCP Bundlehttps://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-aarch64-unknown-linux-musl.mcpb

Distributed as an MCP bundle (`https://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-aarch64-unknown-linux-musl.mcpb`) — download it and import the bundle in your MCP client.

MCP Bundlehttps://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-x86_64-unknown-linux-musl.mcpb

Distributed as an MCP bundle (`https://github.com/clouatre-labs/aptu-coder/releases/download/v0.47.0/aptu-coder-0.47.0-x86_64-unknown-linux-musl.mcpb`) — download it and import the bundle in your MCP client.

README9 min read

aptu-coder

crates.io License REUSE SLSA Level 3 OpenSSF Best Practices

A Model Context Protocol (MCP) code-intelligence server that gives AI coding agents pre-parsed symbol tables instead of raw file bytes, cutting token usage by up to 59% in the cited benchmark conditions (see Benchmarks). OpenSSF silver certified: fewer than 1% of open source projects reach this level.

Note

Native agent tools (regex search, path matching, file reading) handle targeted lookups well. aptu-coder handles the mechanical, non-AI work: mapping directory structure and extracting symbols, so a coding agent's context window is spent reasoning instead of re-deriving structure on every call.

Most code-intelligence tooling for AI agents indexes a codebase into a cloud embedding or vector store and retrieves by similarity search. aptu-coder instead parses the codebase on-device with tree-sitter and serves it locally over MCP: no source code leaves the machine, and retrieval is exact (symbol tables) rather than approximate (nearest-neighbor similarity).

Benchmarks

Paired comprehension tasks on Claude Code (MCP mode vs native shell search). Methodology: Django auth migration (v12) and OpenFAST AeroDyn integration audit (v13).

TaskModeSonnet 4.6Haiku 4.5Savings
Django (Python)MCP112k tokens, $0.39406k tokens, $0.4259% fewer tokens, 59% cheaper (Sonnet)
Django (Python)Native276k tokens, $0.95473k tokens, $0.5314% fewer tokens, 21% cheaper (Haiku)
OpenFAST (Fortran)MCP472k tokens, $1.65687k tokens, $0.7246% fewer tokens, 42% cheaper (Sonnet)
OpenFAST (Fortran)Native877k tokens, $2.852162k tokens, $2.2168% fewer tokens, 68% cheaper (Haiku)

A real end-to-end multi-agent run against this repository itself: five refactoring issues (#1578–#1582) fixed by the coder skill in one orchestrated session — 23 subagent spawns (5 scout, 1 guard, 10 build, 7 check), ~1h42m, three human interventions — producing PRs #1584–#1588, all merged with CI green. Case study.

Scope of the benchmark claims

The token-savings figures above come from single, focused comprehension tasks where the agent used aptu-coder instead of shell search. Agentic coding loops have bash and ripgrep and can search the repo directly. The v19 benchmark program (N=20 paired sessions, pre-registered claim gate) measured aptu-coder in those loops: no measurable answer-quality gain over bash + ripgrep on structural fan-in tasks (pooled paired F1 diff mean -0.071, 95% CI [-0.179, +0.038]; gate NOT-SUPPORTED); tool activation itself was reliable when tools were surfaced directly. Recommended uses: premise grounding for multi-agent workflows, and non-agentic MCP consumers (IDE assistants, CI jobs, scoring pipelines).

Overview

Architecture diagram: an AI agent connects over MCP to aptu-coder, whose analyze tools feed tree-sitter parsing into the formatter that produces the MCP response

Figure 1: An AI agent connects over MCP to aptu-coder, whose analyze tools feed tree-sitter parsing into the formatter.

aptu-coder is a comprehension layer for coding agents: it gives an agent harness precise structural context about a codebase, directory trees, and symbol definitions, without the agent reading raw files or re-deriving structure on every call. That prevents context starvation on large or unfamiliar codebases while keeping the result set small enough to fit the model's context window. It supports 18 languages (see Supported Languages) and integrates with any MCP-compatible orchestrator.

Structural context is built once and reused: an on-disk cache keyed by blake3 content hashes keeps results correct across concurrent writes. For consumers that hold source text without an on-disk path, aptu-coder-core also exposes analyze_str as a public Rust library API (see ARCHITECTURE.md).

Further reading on the design philosophy, from the author's blog: The Agentic SDLC Governance Stack, Context Engineering for Multi-Agent Reliability, and Orchestrating AI Agents: Subagent Architecture.

Supported Languages

Astro, C/C++, C#, CSS, Fortran, Go, HTML, Java, JavaScript, JSON, Kotlin, Markdown, Python, Rust, TOML, TSX, TypeScript, YAML. The full extension map lives in crates/aptu-coder-core/src/lang.rs.

Installation

Homebrew (macOS and Linux)

bash
brew install clouatre-labs/tap/aptu-coder

Update: brew upgrade aptu-coder

cargo-binstall (no Rust required)

bash
cargo binstall aptu-coder

cargo install (requires Rust toolchain)

bash
cargo install aptu-coder

Quick Start

Build from source

bash
cargo build --release

The binary is at target/release/aptu-coder.

Configure MCP Client

stdio (default) — the client spawns and owns the server process; this works with orchestrators that spawn delegates (goose, pi) as well as single clients:

bash
claude mcp add --transport stdio aptu-coder -- aptu-coder

Or add manually to .mcp.json at your project root (shared with your team via version control):

json
{
  "mcpServers": {
    "aptu-coder": {
      "command": "aptu-coder",
      "args": []
    }
  }
}

Streamable HTTP (optional) — runs a single shared server process instead of one per client. Only worth it if you specifically want a daemon-style setup:

bash
aptu-coder --port 49200            # or: brew services start aptu-coder
claude mcp add --transport http aptu-coder http://127.0.0.1:49200/mcp

For goose, add to ~/.config/goose/config.yaml:

yaml
extensions:
  aptu-coder:
    type: streamable_http
    uri: http://127.0.0.1:49200/mcp
    name: aptu-coder
    timeout: 300

Tools

All optional parameters may be omitted. analyze_directory, analyze_file, and analyze_module accept summary (compact output, auto-triggers above 50K chars) and cursor (pagination token). Page size is server-owned; there is no client page_size parameter (passing one returns INVALID_PARAMS).

  • analyze_directory -- directory tree with LOC, function, and class counts; respects .gitignore
  • analyze_file -- functions, classes, and imports with signatures and line ranges; graceful fallback for unsupported extensions
  • analyze_module -- lightweight function and import index (~75% smaller than analyze_file)
  • edit_overwrite -- create or overwrite a file; creates parent directories
  • edit_replace -- replace a unique exact text block (or all occurrences with replace_all); batch form edits[] applies multiple replacements atomically; optional expected_content_hash rejects stale edits
  • exec_command -- run a shell command; output is capped, filtered, and returned with exit code; cancelled requests kill the command

Tool parameters, constraints, and examples are available via your MCP client's tool inspector or tools/list response.

Output Management

For large codebases, several mechanisms prevent context overflow.

Pagination

analyze_file appends a NEXT_CURSOR: line when output is truncated. Pass the token back as cursor to fetch the next page. summary=true and cursor are mutually exclusive; passing both returns an error.

# Response ends with:
NEXT_CURSOR: eyJvZmZzZXQiOjUwfQ==

# Fetch next page:
analyze_file path: /my/project/src/lib.rs cursor: eyJvZmZzZXQiOjUwfQ==

exec_command output caps

exec_command applies three independent byte-level caps to prevent large command outputs from flooding the context:

stdout keeps the last 30,000 chars, stderr the last 10,000 (tail-preserving, so errors appear at the end), and the combined output_text is capped at 50,000 chars as a safety net after interleaving.

The 30k stdout cap is data-driven: analysis of 27,981 observed exec_command calls shows only 0.33% exceed this limit. When any cap fires, output_truncated: true is set in the response and recorded in the JSONL metrics.

Recovering capped output: when output is capped, the response includes MCP resource links (aptu-overflow://slot-{seq}/stdout, /stderr, /interleaved) pointing to the full raw capture for that invocation (last-run-wins); read them via resources/read. If a filter capped the output, a hint line points to the pre-filter capture file.

A server-owned post-exit drain window (500 ms) waits for any background subprocess still holding the pipe open. If it expires before the pipe closes, exit_code is null and output_truncated: true is set.

exec_command output filters

A built-in filter table suppresses per-file noise from chatty CLI tools before output reaches the model. Filters apply to stdout, stderr, and interleaved output on success only; raw output is always preserved on failure.

Built-in rules cover the usual suspects: git pull/fetch/push strip diff-stat, remote-progress, and ref noise; git log/status cap at 20 lines; git show strips patch hunks; git diff strips ANSI escapes; git commit/add strip hook output; cargo build/test strip Compiling/Checking/Fresh progress lines. Clean output collapses to a short ok confirmation.

Project-local rules can be added in .aptu/filters.toml. Parse errors and unrecognized schema_version values (version != 1) fall back to the built-in table with a logged warning; no crash occurs. When a filter fires, filter_applied in structuredContent identifies which rule matched.

Non-Interactive Pipelines

In single-pass subagent sessions, prompt caches are written but never reused. Benchmarks showed MCP responses writing ~2x more to cache than native-only workflows, adding cost with no quality gain. Set DISABLE_PROMPT_CACHING=1 (or DISABLE_PROMPT_CACHING_HAIKU=1 for Haiku-specific pipelines) to avoid this overhead.

The server's own instructions are deliberately minimal, a single short paragraph: start with analyze_directory for a package/module map, then use analyze_module/analyze_file for per-file detail, with a pointer to docs/METRICS.md for JSONL metrics and jq recipes. MCP clients that surface server instructions will present this guidance automatically to the agent.

Environment Variables

Cache and runtime

VariableDefaultDescription
APTU_CODER_DIR_CACHE_CAPACITY20LRU cache size for directory-analysis results.
APTU_CODER_DISK_CACHE_DIR$XDG_DATA_HOME/aptu-coder/analysis-cacheDirectory for the L2 analysis disk cache. Created automatically if it does not exist.
APTU_CODER_DISK_CACHE_DISABLEDunsetSet to 1 to disable the L2 analysis disk cache entirely.
APTU_CODER_FILE_CACHE_CAPACITY100LRU cache size for file-analysis results.
APTU_CODER_METRICS_EXPORT_FILEunsetAbsolute path for a one-shot JSONL metrics export on shutdown.
APTU_CODER_PORTunsetPort for streamable HTTP mode. Equivalent to --port N; --port takes precedence. When unset and --port is not passed, stdio mode is used.
APTU_CODER_BEARER_TOKENunsetBearer token for Streamable HTTP transport authentication. A warning is logged if the value is fewer than 32 characters.
APTU_CODER_SESSION_ORIGINunsetMarks the session origin for JSONL metrics: agent, maintainer, or test. Invalid values log a one-time warning and are treated as unset.
APTU_SHELLunsetShell for exec_command. Defaults to bash then /bin/sh.

Observability

For the JSONL schema, OTel configuration, and span attribute policy, see:

Documentation

  • Blog - Design philosophy and agent-harness engineering behind aptu-coder
  • AGENTS.md - Contributor reference: project structure, commands, rmcp footguns, tool parameter constraints
  • ARCHITECTURE.md - Design goals, module map, data flow, language handler system, caching strategy
  • CONTRIBUTING.md - Development workflow, commit conventions, PR checklist
  • DESIGN-GUIDE.md - Design decisions, rationale, and replication guide for building high-performance MCP servers
  • MCP Best Practices - Best practices for agentic loops, orchestration patterns, MCP tool design, memory management, and safety controls
  • METRICS.md - Metrics schema, JSONL format, and retention policy
  • ROADMAP.md - Development history and future direction
  • SECURITY.md - Security policy and vulnerability reporting

License

Apache-2.0. See LICENSE for details.

Similar modules

Browse Code search