A runtime-free MCP server that converts source code into language-agnostic ASTs using tree-sitter grammars.
https://github.com/micl2e2/code-to-treeYou're building tools that need to understand code structure across multiple languages. Right now, you're probably juggling different AST libraries, each with their own APIs, installation requirements, and quirks. What if you could get consistent, accurate ASTs for C, C++, Rust, Ruby, Go, Java, and Python from a single binary?
code-to-tree is a runtime-free MCP server that converts source code into language-agnostic ASTs using tree-sitter grammars. One binary, zero dependencies, consistent output format across all supported languages.
Most AST solutions force you into language-specific ecosystems. Want to analyze Python? Install the ast
module and learn its API. Need C++? Now you're dealing with libclang. Add Rust to the mix? Time for syn crates and a completely different approach.
Each tool has different output formats, installation requirements, and API conventions. Your code analysis pipeline becomes a patchwork of language-specific parsers, each requiring different runtime environments.
Single Binary, Universal Parsing: Download one executable. Parse any supported language. No Python environments, no Node.js dependencies, no JVM requirements.
Consistent AST Format: tree-sitter provides uniform AST structures across languages. Your analysis code works the same whether you're parsing C functions or Rust modules.
MCP Integration: Plugs directly into Claude and other MCP-compatible tools. Your AI assistant gets precise structural understanding of your codebase without you building custom integrations.
Zero Runtime Overhead: Everything's compiled into the binary. No package managers, no version conflicts, no "it works on my machine" issues.
Cross-Language Refactoring Tools: Build tools that understand similar patterns across C++ and Rust codebases. The consistent AST format means your pattern matching logic works across both languages.
AI-Assisted Code Review: Give your LLM precise structural context about code changes. Instead of feeding raw text, provide the actual AST so it understands function boundaries, variable scopes, and control flow.
Static Analysis Pipelines: Write analysis rules once, apply them across your polyglot codebase. Check for similar anti-patterns in Java and Go using the same rule engine.
Documentation Generation: Extract function signatures, class hierarchies, and module structures across languages for consistent API documentation.
Add it to your Claude config:
{
"mcpServers": {
"code-to-tree": {
"command": "/path/to/code-to-tree"
}
}
}
Now Claude can analyze code structure directly:
The AST data gives Claude precise understanding instead of guessing from source text.
The tree-sitter foundation means you get production-quality parsing. These aren't toy parsers—tree-sitter powers syntax highlighting in major editors and is battle-tested across millions of codebases.
The standalone binary approach eliminates the dependency nightmare. Ship it with your tools, include it in Docker containers, or run it on bare metal. It just works.
For developers building code analysis tools, AI workflows, or cross-language development environments, code-to-tree provides the consistent, reliable AST parsing that makes everything else possible.
Get the binary from the releases page or build it yourself. Your multi-language code analysis just got simpler.