MC

micl2e2/code-to-tree

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

90 stars 12 forks Качество 53 Тренд 0MIT

micl2e2/code-to-tree - кандидат на сервер MCP, импортированный из https://github.com/micl2e2/code-to-tree.

Обзор

micl2e2/code-to-tree - кандидат на сервер MCP, импортированный из https://github.com/micl2e2/code-to-tree.

Обзор (машинный перевод)

Сервер MCP: Code-to-Tree Использование Code-to-Tree Настройка MCP клиентов Здание (Windows)

  • Строительство (macOS)

Сервер MCP: Code-to-Tree

Цели сервера Code-to-Tree:

  1. Дать LLM возможность ** точно** преобразовывать исходный код в AST (Abstract Syntax Tree), независимо от языка. 2.Одним standalone binary должно быть все, что нужно клиенту MCP.

Эти цели подразумевают:

1.Основной синтаксический парсер должен быть универсален достаточно. Мы здесь. Выберите дерево-ситер, и языки: C, C++, Rust, Ruby, Go, Java, Python. 2.Сервер должен быть способен нести все возможности внутри само по себе, налагая * * минимальную * * зависимость программного обеспечения от конечного пользователя Машина. Выбираем mcpc.

Скриншоты:

Вышеприведенные скриншоты получаются путем постановки указанного вопроса в [[0]].

(ВАЖНОЕ ПРИМЕЧАНИЕ: LLM не несут ответственности за создание идентичных Результат по тому же вопросу, вы, скорее всего, получите совершенно другой. Стиль или контент. Скриншоты или вопросы, представленные здесь, предназначены только для ссылки.

Использование Code-to-Tree

Прежде чем что-либо сделать, вы должны иметь исполняемый код к дереву на вашем Машина (“код к дереву”).

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Table of Contents

MCP Server: code-to-tree

The code-to-tree server’s goals are:

  1. Give LLMs the capability of accurately converting source code into AST(Abstract Syntax Tree), regardless of language.
  2. One standalone binary should be everything the MCP client needs.

These goals imply:

  1. The underlying syntax parser should be versatile enough. Here we choose tree-sitter, and languages are: C, C++, Rust, Ruby, Go, Java, Python.
  2. The server should be able to carry all capabilities within itself, imposing minimum software dependencies on the end user’s machine. Here we choose mcpc.

Screenshots:

The above screenshots are obtained by asking the question specified in q.md.

(IMPORTANT NOTE: LLMs have no responsibility of generating the identical result for the same question, you will likely get a completely different style or content. The screenshots or questions provided here are just for the reference)

Using code-to-tree

Before everthing, you need to have the code-to-tree executable on your machine (code-to-tree.exe for Windows, code-to-tree for macOS), you can download at GitHub release page or build it yourself. Once downloaded, you configure your MCP clients to install it, check the section “Configure MCP Clients” for more details.

Configure MCP Clients

Here we use Claude as the example.

Windows

In your Claude configuration (C:\Users\YOUR_NAME\AppData\Roaming\Claude\claude_desktop_config.json), specify the location of code-to-tree.exe:

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

macOS

In your Claude configuration, (~/Library/Application Support/Claude/claude_desktop_config.json) specify the location of code-to-tree

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

Building (Windows)

1. Prepare environment

  1. download & install MSYS2.
  2. open application “MSYS2 MINGW64”
  3. run pacman -S make gcc git

2. Prepare tree-sitter libraries

Here we need to compile and install tree-sitter and all related grammars.

Clone them:

git clone https://github.com/tree-sitter/tree-sitter
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →