code-to-tree
code-to-tree is a single-binary Model Context Protocol (MCP) server that converts source code into an abstract syntax tree (AST) representation, regardless of the programming language. It enables MCP-compatible clients to analyze and navigate code structure programmatically via a unified server interface.
About this tool
code-to-tree
Category: Repository – Code Analysis MCP Servers
Tags: code-analysis, AST, multi-language
Source: https://github.com/micl2e2/code-to-tree
Overview
code-to-tree is a single-binary, runtime-free Model Context Protocol (MCP) server that converts source code into an abstract syntax tree (AST) representation, regardless of the programming language. It exposes this functionality through a unified MCP-compatible interface so clients can analyze and navigate code structure programmatically.
Features
-
MCP server implementation
- Implements the Model Context Protocol for tool/server interoperability.
- Usable by any MCP-compatible client.
-
Single-binary, runtime-free design
- Distributed as a single compiled binary.
- Does not require an external runtime environment at execution time.
-
Language-agnostic AST generation
- Converts source code into an abstract syntax tree independently of programming language.
- Provides a unified structural representation suitable for multi-language codebases.
-
Programmatic code structure access
- Lets clients inspect and navigate code structure via AST.
- Supports automated code analysis and tooling workflows over MCP.
-
Example configurations and tool calls
- Includes sample JSON tool call files (
toolcall-1.json,toolcall-2.json,toolcall-3.json) andtoolslist.jsonillustrating how to interact with the server through MCP. - Example patch file (
ts1.patch) demonstrating AST-related usage or integration scenarios.
- Includes sample JSON tool call files (
-
Documentation and assets
README.md/README.orgdescribing setup and usage (in-repo).- Screenshot assets (
chathistory.png,wholeast.png) showing example interactions and AST visualizations.
Licensing
- License file:
LICENSE(specific terms are in the repository license file).
Technical Artifacts
- Core implementation mainly in
code-to-tree.c. - Build configuration via
Makefile. - GitHub Actions workflows under
.github/workflowsfor CI-related tasks.
Pricing
- Not applicable; this is an open-source GitHub repository. No pricing plans are specified in the provided content.
Loading more......
Information
Categories
Tags
Similar Products
6 result(s)A tool that extracts essential code structure from large codebases into an AI-digestible format; commonly used as an MCP-accessible utility to help AI agents understand and work with complex repositories.
CodeGraphContext is an MCP server that indexes local code into a graph database, exposing structured code context to AI assistants. It enables graph-based code exploration and reasoning for coding agents via the MCP protocol.
An MCP Server integration for CodeScene, allowing MCP tools to analyze codebases with CodeScene’s behavioral code analysis and insights that connect code, teams, and business priorities.
A server wrapping the code2flow tool as an MCP service, enabling AI applications to generate and access code call graphs using a standardized protocol. Directly demonstrates MCP server integration.
A Model Context Protocol server that connects LLMs to the Compiler Explorer API, enabling compilation and exploration of code across different compilers and languages. This is an MCP server providing LLMs with code analysis and compiler features.
Official MCP server for CodeLogic, providing access to code dependency analytics, architectural risk analysis, and impact assessment tools.