Token导航 LogoToken导航TokenDH.com
Code To Tree logo
开发工具未说明官方级别未说明来源级核验

Code To Tree

MCP Server

MCP Server的code-to-tree服务是一个独立二进制工具,能够准确将多种编程语言的源代码转换为抽象语法树(AST),适用于需要代码分析和处理的场景。

工具数

0

提示词数

0

GitHub Stars

83

资源数

0
Claude开发工具命令行工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

micl2e2

提供方

micl2e2

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

目录

MCP服务器:代码到树

树服务器目标的代码是:

  1. 赋予LLM以下能力 准确地 将源代码转换为

AST(抽象语法树),无论语言如何。

  1. 独立 二进制文件应该是MCP客户端所需的一切。

这些目标意味着:

  1. 底层语法分析器应该是 多才多艺的 够了。在这里我们

选择 树保姆,语言有:C、C++、Rust、Ruby、Go、Java、Python。

  1. 服务器应该能够承载其中的所有功能

本身,令人印象深刻 最小 软件对最终用户的依赖性 机器。在这里我们选择 多用途计算程序设计.

屏幕截图:

以上截图是通过询问指定问题获得的 在 q.md.

(重要提示:LLM不负责生成相同的 对于同一个问题,你可能会得到一个完全不同的结果 风格或内容。此处提供的截图或问题仅供参考)

使用代码树

在做任何事情之前,你需要有代码在你的 机器(code-to-tree.exe 对于Windows, code-to-tree 对于macOS), 你可以在GitHub上下载 或者自己建造。曾经 下载后,您可以配置MCP客户端来安装它,请查看部分 *“配置MCP客户端”* 了解更多详情。

配置MCP客户端

这里我们以克劳德为例。

视窗

在您的Claude配置中 (C:\Users\YOUR_NAME\AppData\Roaming\Claude\claude_desktop_config.json), 指定位置 code-to-tree.exe:

{
    "mcpServers": {
	    "code-to-tree": { "command": "C:\\path\\to\\code-to-tree.exe" }
    }
}

macOS

在Claude配置中, (~/Library/Application Support/Claude/claude_desktop_config.json) 指定位置 code-to-tree

{
    "mcpServers": {
	    "code-to-tree": { "command": "/path/to/code-to-tree" }
    }
}

建筑(窗户)

1.准备环境

  1. 下载并安装MSYS2。
  2. 开放式应用程序“MSYS2 MINGW64”
  3. pacman -S make gcc git

2.准备树木看护图书馆

在这里,我们需要编译和安装树保姆和所有相关语法。

克隆它们:

git clone https://github.com/tree-sitter/tree-sitter

git clone https://github.com/tree-sitter/tree-sitter-c

git clone https://github.com/tree-sitter/tree-sitter-cpp

git clone https://github.com/tree-sitter/tree-sitter-rust

git clone https://github.com/tree-sitter/tree-sitter-ruby

git clone https://github.com/tree-sitter/tree-sitter-go

git clone https://github.com/tree-sitter/tree-sitter-java

编译并安装它们:

cd tree-sitter && OS=1 make install

cd tree-sitter-c && OS=1 make install

cd tree-sitter-cpp && OS=1 make install

cd tree-sitter-rust && OS=1 make install

cd tree-sitter-ruby && OS=1 make install

cd tree-sitter-go && OS=1 make install

cd tree-sitter-java && OS=1 make install

3.构建代码树

安装mcpc:

git clone https://github.com/micl2e2/mcpc
cd mcpc && make install

将代码编译成树:

cd mcpc/example/code-to-tree

CFLAGS="-I/usr/local/include -L/usr/local/lib" make

# Check the binary
file code-to-tree.exe

# Remember the binary's location
pwd
# Assume the output is: /c/path/to/code-to-tree.exe

建筑(macOS)

1.准备环境

  1. Xcode 命令行工具

2.准备树木看护图书馆

在这里,我们需要编译和安装树保姆和所有相关语法。

克隆它们:

git clone https://github.com/tree-sitter/tree-sitter

git clone https://github.com/tree-sitter/tree-sitter-c

git clone https://github.com/tree-sitter/tree-sitter-cpp

git clone https://github.com/tree-sitter/tree-sitter-rust

git clone https://github.com/tree-sitter/tree-sitter-ruby

git clone https://github.com/tree-sitter/tree-sitter-go

git clone https://github.com/tree-sitter/tree-sitter-java

编译并安装它们:

cd tree-sitter && make install

cd tree-sitter-c && make install

cd tree-sitter-cpp && make install

cd tree-sitter-rust && make install

cd tree-sitter-ruby && make install

cd tree-sitter-go && make install

cd tree-sitter-java && make install

3.构建代码树

安装mcpc:

git clone https://github.com/micl2e2/mcpc
cd mcpc && make install

将代码编译成树:

cd mcpc/example/code-to-tree

make

# Check the binary
file ./code-to-tree

# Remember the binary's location
pwd
# Assume the output is: /path/to/code-to-tree

目录标签

目录标签

Claude开发工具命令行工具C本地部署代码解析抽象语法树多语言支持独立二进制

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明nonelocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP