Code Analyze MCP Server

MCP server for code structure analysis using tree-sitter.

Local serverstdioPython

What is the Code Analyze MCP Server?

MCP server for code structure analysis using tree-sitter.

The short version

Standalone MCP server for code structure analysis using tree-sitter. OpenSSF silver certified: fewer than 1% of open source projects reach this level.

aptu-coder is a Model Context Protocol server that gives AI agents precise structural context about a codebase: directory trees, symbol definitions, and call graphs, without reading raw files. It supports 18 languages (see Supported Languages) and integrates with any MCP-compatible orchestrator.

The tools it exposes

The server publishes 10 tools. What each one is for:

  • summary — boolean
  • cursor — string
  • page_size — integer
  • analyze_directory — Directory tree with LOC, function, and class counts; respects .gitignore
  • analyze_file — Functions, classes, and imports with signatures and line ranges; returns graceful fallback (line count, file head, no AST) for unsupported extensions
  • analyze_module — Lightweight function and import index (~75% smaller than analyze_file); returns graceful fallback (empty index with note) for unsupported extensions
  • analyze_symbol — Call graph for a named symbol across a directory; callers, callees, call depth
  • edit_overwrite — Create or overwrite a file; creates parent directories
  • edit_replace — Replace a unique exact text block or all non-overlapping occurrences (replace_all=true); errors if zero or multiple matches; empty new_text deletes
  • exec_command — Run a shell command; returns stdout, stderr, exit code; output capped and filtered; optional timeout_secs (kill on expiry) and drain_timeout_secs

Recorded tools

  • summary — boolean
  • page_size — integer
  • analyze_directory — Directory tree with LOC, function, and class counts; respects .gitignore
  • analyze_file — Functions, classes, and imports with signatures and line ranges; returns graceful fallback (line count, file head, no AST) for unsupported extensions
  • analyze_module — Lightweight function and import index (~75% smaller than analyze_file); returns graceful fallback (empty index with note) for unsupported extensions
  • analyze_symbol — Call graph for a named symbol across a directory; callers, callees, call depth
  • edit_overwrite — Create or overwrite a file; creates parent directories
  • edit_replace — Replace a unique exact text block or all non-overlapping occurrences (replace_all=true); errors if zero or multiple matches; empty new_text deletes the block; CRLF normalized before matching; returns occurrences_replaced
  • exec_command — Run a shell command; returns stdout, stderr, exit code; output capped and filtered; optional timeout_secs (kill on expiry) and drain_timeout_secs (post-exit drain window); heredoc rejected before spawn (file-write patter

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
summaryboolean
page_sizeinteger
analyze_directoryDirectory tree with LOC, function, and class counts; respects .gitignore
analyze_fileFunctions, classes, and imports with signatures and line ranges; returns graceful fallback (line count, file head, no AST) for unsupported extensions
analyze_moduleLightweight function and import index (~75% smaller than analyze_file); returns graceful fallback (empty index with note) for unsupported extensions
analyze_symbolCall graph for a named symbol across a directory; callers, callees, call depth
edit_overwriteCreate or overwrite a file; creates parent directories
edit_replaceReplace a unique exact text block or all non-overlapping occurrences (replace_all=true); errors if zero or multiple matches; empty new_text deletes the block; CRLF normalized before matching; returns occurrences_replaced
exec_commandRun a shell command; returns stdout, stderr, exit code; output capped and filtered; optional timeout_secs (kill on expiry) and drain_timeout_secs (post-exit drain window); heredoc rejected before spawn (file-write patter

Example prompts to try

  • “Use Code Analyze MCP to summary.”
  • “Use Code Analyze MCP to cursor.”
  • “Use Code Analyze MCP to page size.”

Frequently asked questions

MCP server for code structure analysis using tree-sitter. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.