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: Astro, C/C++, C#, CSS, Fortran, Go, HTML, Java, JavaScript, JSON, Kotlin, Markdown, Python, Rust, TOML, TSX, TypeScript, YAML.

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.
ExecCommandParams
MetricEvent
A single metric event emitted by a tool invocation.
MetricsSender
Sender half of the metrics channel; cloned and passed to tools for event emission.
MetricsWriter
Receiver half of the metrics channel; drains events and writes them to daily-rotated JSONL files.
ShellOutput

Constants§

STDIN_MAX_BYTES

Functions§

extract_and_set_trace_context
Extract W3C Trace Context from MCP request _meta field and set as parent span context.
init_log_appender
Initializes OpenTelemetry log appender if OTEL_EXPORTER_OTLP_ENDPOINT is set.
init_meter
Initializes OpenTelemetry metrics SDK if OTEL_EXPORTER_OTLP_ENDPOINT is set.
init_otel
Initializes OpenTelemetry with OTLP export if OTEL_EXPORTER_OTLP_ENDPOINT is set.
migrate_legacy_metrics_dir
Migrate legacy metrics directory from code-analyze-mcp to aptu-coder.