Skip to main content

Crate aptu_coder

Crate aptu_coder 

Source
Expand description

Rust MCP server for code structure analysis using tree-sitter.

This crate exposes seven MCP tools for multiple programming languages:

Analyze family:

  • analyze_directory: Directory tree with file counts and structure
  • analyze_file: Semantic extraction (functions, classes, imports)
  • analyze_symbol: Call graph analysis (callers and callees)
  • analyze_module: Lightweight function and import index

Edit family:

  • edit_overwrite: Create or overwrite files
  • edit_replace: Replace text blocks in files

Exec family:

  • exec_command: Run shell commands with progress notifications

Key entry points:

Languages supported: Rust, Go, Java, Python, TypeScript, TSX, Fortran, JavaScript, C/C++, C#.

Modules§

analyze
Main analysis engine for extracting code structure from files and directories.
logging
MCP logging integration via tracing.
metrics
Metrics collection and daily-rotating JSONL emission.
otel

Structs§

ClientMetadata
Session and client metadata recorded as span attributes on every tool call.
CodeAnalyzer
MCP server handler that wires the four analysis tools to the rmcp transport.

Functions§

extract_and_set_trace_context
Extract W3C Trace Context from MCP request _meta field and set as parent span context.
summary_cursor_conflict
Returns true when summary=true and a cursor are both provided, which is an invalid combination since summary mode and pagination are mutually exclusive.