Code to Tree
๐ ๐ ๐ ๐ง ๐ช ๐ - A single-binary MCP server that converts source code into AST, regardless of language.
What is Code to Tree?
Code to Tree is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐ ๐ ๐ ๐ง ๐ช ๐ - a single-binary mcp server that converts source code into ast, regardless of language.
๐ ๐ ๐ ๐ง ๐ช ๐ - A single-binary MCP server that converts source code into AST, regardless of language.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- ๐ ๐ ๐ ๐ง ๐ช ๐ - A single-binary MCP server that converts sourc
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx code-to-treeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Code to Tree
Code-to-Tree is a zero-dependency, single-binary MCP server that parses source code files into Abstract Syntax Trees (ASTs) using tree-sitter parsers, supporting C, C++, Rust, Ruby, Go, Java, and Python. Because LLMs work more accurately with structured AST representations than raw source text, this server enables AI assistants to reason about code structure, detect patterns, generate documentation, and perform refactoring analysis with higher precision. The server ships as a standalone native binary with no Node.js, Python, or other runtime required, making it easy to distribute and run on Linux, macOS, and Windows.
Prerequisites
- A pre-built binary downloaded from the GitHub releases page (https://github.com/micl2e2/code-to-tree/releases), or a C build toolchain (make, gcc/clang) to compile from source
- An MCP-compatible client such as Claude Desktop, Cursor, or Windsurf
- Source code files in one of the supported languages: C, C++, Rust, Ruby, Go, Java, or Python
Download the pre-built binary
Visit the GitHub releases page and download the binary for your platform (Linux x86_64, macOS arm64/x86_64, or Windows). Place it in a directory on your PATH or note its absolute path.
# macOS example (adjust version and platform as needed)
curl -L https://github.com/micl2e2/code-to-tree/releases/latest/download/code-to-tree-macos-arm64 \
-o /usr/local/bin/code-to-tree
chmod +x /usr/local/bin/code-to-treeVerify the binary works
Run the binary directly to confirm it starts without errors. A working binary will initialize and wait for MCP protocol input.
code-to-tree --versionConfigure your MCP client (macOS/Linux)
Open your MCP client configuration file and add the code-to-tree server entry. Use the absolute path to the binary.
{
"mcpServers": {
"code-to-tree": {
"command": "/usr/local/bin/code-to-tree"
}
}
}Configure your MCP client (Windows)
On Windows, use the .exe file path in your MCP client configuration.
{
"mcpServers": {
"code-to-tree": {
"command": "C:\\tools\\code-to-tree.exe"
}
}
}Restart your MCP client and test
Restart your MCP client so it connects to the new server. Ask Claude to parse a source file into an AST to verify the tool is working.
Code to Tree Examples
Client configuration
Minimal Claude Desktop configuration for the code-to-tree single-binary server on macOS.
{
"mcpServers": {
"code-to-tree": {
"command": "/usr/local/bin/code-to-tree"
}
}
}Prompts to try
Example prompts that use the AST server to analyze and document code.
- "Parse src/main.rs into an AST and list all function definitions with their signatures"
- "Convert app.py to an AST and identify all class definitions and their methods"
- "Parse lib/parser.c using AST and find all places where malloc is called without a matching free"
- "Generate documentation for every exported function in src/api.go based on its AST structure"
- "Compare the AST structure of old_impl.java and new_impl.java and summarize structural differences"
- "Parse the Ruby file models/user.rb and list all method names and their argument counts"Troubleshooting Code to Tree
Permission denied when running the binary on macOS
Run 'chmod +x /path/to/code-to-tree' to make it executable. On macOS, you may also need to allow it in System Settings > Privacy & Security > Security if it is blocked by Gatekeeper.
MCP client shows 'server disconnected' immediately
Test the binary by running it directly in a terminal. Confirm the path in your config is the absolute path to the binary, not a relative one. On Windows, make sure you use double backslashes in the JSON path string.
Language not supported or AST parse fails
Code-to-Tree currently supports C, C++, Rust, Ruby, Go, Java, and Python. Files in other languages will not parse. Check that the file extension matches one of the supported languages.
Frequently Asked Questions about Code to Tree
What is Code to Tree?
Code to Tree is a Model Context Protocol (MCP) server that ๐ ๐ ๐ ๐ง ๐ช ๐ - a single-binary mcp server that converts source code into ast, regardless of language. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Code to Tree?
Follow the installation instructions on the Code to Tree GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Code to Tree?
Code to Tree works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Code to Tree free to use?
Yes, Code to Tree is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Code to Tree Alternatives โ Similar Developer Tools Servers
Looking for alternatives to Code to Tree? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
โ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
โ 155.8kJava ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Gemini CLI
โ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
โ 87.3kโญ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
โ 86.0kModel Context Protocol Servers
CC Switch
โ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Code to Tree in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Code to Tree?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.