Code Analyze MCP logo

Code Analyze MCP

Local tree-sitter code analysis over MCP with symbol indexes, call graphs, workspace edits, command execution, and anchor verification.

Install Code Analyze MCP

Run the project’s own setup commands, in order.

Setup steps from the project

Code Analyze MCP installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    brew install clouatre-labs/tap/aptu-coder
    
  2. 2. Install
    cargo binstall aptu-coder
    
  3. 3. Start the server
    brew services start aptu-coder
    
  4. 4. Add to Claude Code
    claude mcp add --transport http aptu-coder http://127.0.0.1:49200/mcp
    
  5. 5. Start the server
    APTU_CODER_PORT=4000 brew services restart aptu-coder
    
  6. 6. Start the server
    aptu-coder --port 49200
    

Overview

Code Analyze MCP maps source trees locally with tree-sitter and exposes compact structural results over MCP instead of requiring agents to inspect every file as raw text. Its tools cover directory metrics, file and module indexes, symbol call graphs, edits, shell commands, and verification of path-line-symbol anchors. It supports 18 languages, uses an on-disk Blake3-keyed cache, and can run through stdio or streamable HTTP. Reach for it when an agent needs deterministic code structure, bounded context, or workspace changes and checks in a local development environment.

Use cases

  • Map a repository before making a code change
  • Trace callers and callees of a named symbol
  • Inspect compact module indexes in large codebases
  • Apply guarded text edits with content hashes
  • Verify generated path, line, and symbol references

Key features

  • Tree-sitter analysis across 18 languages
  • Directory, file, module, and symbol inspection
  • Local Blake3-keyed structural cache
  • Guarded file editing and shell execution
  • Batch verification of source anchors
  • Stdio and streamable HTTP transports

Tools6

What Code Analyze MCP lets your agent do. Expand a tool for its parameters.

Self-reported~176 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 73d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars7Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed6Callable tools this server registers over MCP.

How Code Analyze MCP works

What Code Analyze MCP does

Code Analyze MCP provides local code intelligence for MCP-compatible coding agents. It parses supported source files with tree-sitter and returns structural information such as functions, classes, imports, signatures, line ranges, directory statistics, and symbol relationships. Results are designed to give an agent a compact view of a repository without repeatedly reconstructing its structure from raw file contents.

The server supports Astro, C and C++, C#, CSS, Fortran, Go, HTML, Java, JavaScript, JSON, Kotlin, Markdown, Python, Rust, TOML, TSX, TypeScript, and YAML through their listed file extensions. It also includes workspace mutation and command-execution tools, making it useful for workflows that need both repository understanding and controlled changes.

How it works

Parsing happens on the local machine, so source code is not sent to a hosted indexing service. An on-disk cache keyed by Blake3 content hashes allows structural results to be reused while remaining tied to file contents. The same structural graph supports analysis results and the server's knowledge-graph resource surface.

The server offers two MCP transports. Stdio lets one client own the process lifecycle, while streamable HTTP allows multiple processes or delegated agents to share one running instance. The HTTP mode is suited to orchestrated multi-agent setups where separate server processes could otherwise maintain different instances.

Analysis responses can be compacted automatically when they become large, and analysis tools support cursors for pagination. Directory analysis follows .gitignore, and reported paths are relative to the working directory.

Setup and configuration

Install the aptu-coder binary with Homebrew, cargo binstall, or cargo install; building from source uses the Rust toolchain and produces a release binary under target/release. Start the HTTP server directly with aptu-coder --port 49200, or run it as a Homebrew service. The listening port can be changed with APTU_CODER_PORT.

For stdio, configure an MCP client to launch aptu-coder as its command. For HTTP, point the client at the server's /mcp endpoint. Claude Code supports both documented transport styles, while a project-level .mcp.json can store the stdio configuration for team use.

Tools and capabilities

  • analyze_directory reports a directory tree plus lines-of-code, function, and class counts.
  • analyze_file extracts functions, classes, imports, signatures, and line ranges. Unsupported extensions produce a fallback containing a line count and file head rather than an AST.
  • analyze_module returns a smaller function and import index. Unsupported files produce an empty index with a note.
  • analyze_symbol traces callers, callees, and call depth for a named symbol across a directory.
  • edit_overwrite creates or replaces a file and creates missing parent directories.
  • edit_replace replaces an exact text block once or across non-overlapping matches. It can delete a block with empty replacement text and reject stale content using a Blake3 hash.
  • exec_command runs shell commands and returns output and an exit code, with output filtering and cancellation handling.
  • verify_anchors checks path:line or path:line:symbol references against a workspace, including optional nearby word-boundary symbol matching, and returns one structured verdict per anchor.

Limitations and notes

Unsupported file extensions receive graceful fallbacks from the analysis tools rather than parsed syntax trees. The server owns analysis page sizes; clients should use returned cursors and should not send a page_size parameter. edit_replace requires a unique match unless replacement-all mode is selected, and expected content hashes can cause an edit to fail when the file changed. Shell execution is bounded and applies command and output safeguards, including cancellation behavior and a post-exit drain window.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Code Analyze MCP

Code Analyze MCP is an MCP server that connects AI coding agents to local source workspaces through tree-sitter analysis. Its main tools inspect directories, files, modules, and symbol call graphs, while also supporting guarded edits, shell commands, and path-line-symbol anchor verification over stdio or streamable HTTP.

Install the `aptu-coder` binary with Homebrew, `cargo binstall`, or `cargo install`. Homebrew and cargo-binstall provide packaged installation paths, while cargo install requires a Rust toolchain. You can also build from source with `cargo build --release`.

Configure an MCP client to launch `aptu-coder` for stdio, or connect to the running server at its `/mcp` HTTP endpoint. The server can be started with `aptu-coder --port 49200`, and `APTU_CODER_PORT` changes the listening port.

Yes. Claude Code can connect over stdio with `claude mcp add --transport stdio aptu-coder -- aptu-coder`, or over HTTP with `claude mcp add --transport http aptu-coder http://127.0.0.1:49200/mcp`.

Code Analyze MCP supports 18 language families and formats, including Python, JavaScript, TypeScript, Rust, Go, Java, Kotlin, C and C++, C#, Fortran, HTML, CSS, JSON, YAML, TOML, Markdown, Astro, and TSX.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCode Analyze MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/code-analyze-mcp?style=directory)](https://allmcps.com/mcp/code-analyze-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/code-analyze-mcp"><img src="https://allmcps.com/api/badge/code-analyze-mcp?style=directory" alt="Code Analyze MCP on AllMCPs" /></a>