# Aptu Coder [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/clouatre-labs/aptu-coder  
**GitHub Stars:** 7  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/aptu-coder

## Description
MCP server for code structure analysis using tree-sitter.

## Tools
Capabilities this server exposes over MCP:

- **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

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/clouatre-labs/aptu-coder), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
brew install clouatre-labs/tap/aptu-coder
```

2. Install:

```sh
cargo binstall aptu-coder
```

3. Install:

```sh
cargo install aptu-coder
```

4. Install:

```sh
cargo build --release
```

5. Start the server:

```sh
brew services start aptu-coder
```

6. Configure:

```sh
type: streamable_http
```

## Documentation

## What Aptu Coder does

Aptu Coder is a local MCP code-intelligence server for extracting structure from source trees. It uses tree-sitter to identify functions, classes, imports, signatures, line ranges, and relationships between symbols. Directory analysis includes lines-of-code, function, and class counts, and honors `.gitignore` rules. The server supports Astro, C and C++, C#, CSS, Fortran, Go, HTML, Java, JavaScript, JSON, Kotlin, Markdown, Python, Rust, TOML, TSX, TypeScript, and YAML.

Results are designed to give coding agents concise structural context rather than requiring raw-file inspection for every lookup. Analysis is performed on the local machine, and an on-disk cache keyed by BLAKE3 content hashes allows parsed results to be reused while remaining consistent with file changes.

## How it works

The server communicates through MCP using either stdio or streamable HTTP. Stdio is suited to a single client that starts and owns the process. Streamable HTTP allows multiple consumers to share one running instance and is recommended for orchestrators that spawn delegated agents.

`analyze_directory` reports a relative-path tree with size and symbol counts. `analyze_file` returns imports, functions, classes, signatures, and source ranges. `analyze_module` provides a smaller function and import index for cases where a full file analysis is unnecessary. `analyze_symbol` traces callers, callees, and call depth for a named symbol across a directory.

The analysis tools support compact output and pagination. A `summary` option can request reduced results, and the server automatically switches to compact output for large responses. Pagination uses a returned cursor; page sizing is controlled by the server.

## Setup and configuration

Install the binary with Homebrew, `cargo binstall`, or `cargo install`, or build it from source with Cargo. Homebrew can run the HTTP service in the background. The default HTTP endpoint uses port `49200` and the MCP path `/mcp`; set `APTU_CODER_PORT` to select another port.

For HTTP clients, register the endpoint as a streamable HTTP MCP server. For stdio clients, configure the command as `aptu-coder` with no required arguments. A project-level `.mcp.json` can hold the stdio configuration for sharing with a team.

## Tools and capabilities

- `edit_overwrite` creates or replaces a file and creates missing parent directories.
- `edit_replace` changes an exact text block, optionally replacing all non-overlapping matches. It can delete a block with empty replacement text, normalizes CRLF before matching, and can reject stale edits using an expected BLAKE3 content hash.
- `exec_command` runs shell commands and returns filtered, capped stdout, stderr, and exit status. Cancellation terminates the command, and heredoc-based file-writing patterns are rejected before execution.
- `verify_anchors` checks `path:line` or `path:line:symbol` references against a workspace. It validates file existence, one-based line ranges, and optional symbol matches within a small surrounding window, returning one structured verdict per anchor.
- Unsupported file extensions receive graceful fallbacks: file analysis returns basic line information and a file head, while module analysis returns an empty index with a note.

## Limitations and notes

Aptu Coder requires a local workspace path for its server-side analysis tools. Its structural parsing applies to the listed language and file extensions; unsupported extensions do not produce an AST. `edit_replace` rejects zero matches and ambiguous matches unless configured for replacement of all matches. The command tool caps and filters output, and its server-owned post-exit drain window defaults to 500 milliseconds.

Benchmark results in the project describe token and cost differences for specific focused comprehension tasks. Those measurements should not be treated as a general improvement over shell search for every agentic coding workflow.

_Full upstream README: https://allmcps.com/mcp/aptu-coder/readme_

