# Code to Tree

> Use this tool when you need to generate accurate Abstract Syntax Trees (ASTs) from source code in multiple programming languages, solving code analysis and understanding problems in AI applications, educational tools, and development workflows. It takes source code as input and outputs S-expression formatted AST representations, providing a precise understanding of code semantics. Ideal for use cases requiring language-agnostic code analysis, such as AI-powered coding assistants or code review tools.

Canonical page: https://skillsregistry.net/skills/code-to-tree  
JSON: https://api.skillsregistry.net/v1/skills/code-to-tree

## Description

MCP server implementation by Michael Lee that provides AI assistants with accurate Abstract Syntax Tree (AST) generation from source code across multiple programming languages including C, C++, Rust, Go, Ruby, Python, and Java. Built in C using tree-sitter parsers and the mcpc library, the implementation compiles into a single standalone binary with minimal dependencies, eliminating the need for language-specific runtime environments or complex toolchain installations. The server converts source code into S-expression formatted AST representations, making it valuable for code analysis workflows, educational tools demonstrating language syntax structures, and AI applications requiring precise understanding of code semantics rather than just text-based parsing.

## Trust

- **Trust score (0–1):** 1.00
- **Verification tier:** verified
- **Last scanned:** 2026-09-19

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** other
- **Updated:** 2026-09-19

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/code-to-tree)
- **Repository:** <https://github.com/micl2e2/code-to-tree>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "code-to-tree"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/code-to-tree` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/code-to-tree/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
