tree-sitter-language-pack-using-the-mcp-server
Use when parsing source, extracting code structure, or detecting a language through the tree-sitter-language-pack MCP server's tools, rather than shelling out to the ts-pack CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 485
- Forks
- 71
01 前言 Front Matter
- name
- tree-sitter-language-pack-using-the-mcp-server
- description
- Use when parsing source, extracting code structure, or detecting a language through the tree-sitter-language-pack MCP server's tools, rather than shelling out to the ts-pack CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.
02 资源文件 1
- 参考文档index.md587 B
03 SKILL.md 正文
<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:32a9429c4f5c314cfb1deb3eca4cab52f4c96283e07d68ecf017e925486e72ac Source-Hash: blake3:b8687cf31ac8c66a5ecc15c4f11520ff201d8db14467b7528d5120124e9753a4 Schema-Version: v1 -->
Using the MCP Server
The tree-sitter-language-pack MCP server exposes ts-pack's parsing and
code-intelligence capabilities as MCP tools, so an MCP-compatible client (Claude
Code, Claude Desktop) can parse source, extract structure, and detect languages
directly, with no CLI invocation or glue code.
Standalone skill installation
Installing this skill alone does not register an MCP server or include the plugin launcher.
Install the CLI (for example, brew install xberg-io/tap/ts-pack), then configure your MCP client with
ts-pack mcp as its stdio command. The full product plugin supplies registration where
the runtime supports MCP.
How it runs in this plugin
The plugin auto-registers the server. Its command is the bundled launcher
scripts/mcp-launch.sh, which execs ts-pack mcp. On first run the launcher
resolves a ts-pack binary: it reuses one already on PATH or cached in the
plugin's bin/, then tries npx, then Homebrew, then downloads a prebuilt
from the tool's latest GitHub release. Override the channel with
TS_PACK_LAUNCHER=auto|npx|brew|download.
The mcp subcommand ships in a recent release of the tool. If an older
ts-pack is already on PATH, it may not expose mcp yet — upgrade the binary
(brew upgrade, re-download, or rebuild) to pick it up.
To run it manually:
ts-pack mcp # for Claude Code / Claude Desktop (stdio)
The tools
Parsing and code intelligence:
- parse — syntax tree from
source; requires an explicitlanguage, with optionalformat(sexporjson). It does not detect language from a path — usedetect_languagefirst if you only have a path. - process — code intelligence: structure, imports, exports, symbols, docstrings, comments, diagnostics, chunks. Use
allflag to enable all features. - detect_language — identify language by
pathorcontent(those are the only two parameters; extension detection is implicit inpath).
Language and cache management:
- list_languages — available, downloaded, or manifest languages; optional filter by name.
- info — show language availability and cache status.
- download — prefetch parsers: specific languages, language groups, all, or fresh updates.
- cache_dir — return the cache directory path.
- clean_cache — remove all cached parsers.
Resources
ts-pack://languages— catalog of all known languages.ts-pack://languages/downloaded— currently cached languages.ts-pack://language/{name}— per-language metadata template.
Prompt and completions
- analyze-code — code-analysis prompt (args:
language, optionalfocus). - Language-name autocomplete — available language names in completions.
When to prefer MCP over the CLI or SDK
- Prefer MCP inside an agent session: the agent calls parsing directly as a tool, with no shell-out and no process management.
- Prefer the CLI for one-shot parsing/extraction and shell/CI pipelines.
- Prefer the SDK when embedding parsing in application code or running custom tree-sitter queries.
04 同仓库更多 Skills
tree-sitter-language-pack
Parse and extract code intelligence from 371 programming languages using tree-sitter grammars. Use when writing code that parses source, extracts structure/imports/exports/symbols/docstrings/comments, detects a language, runs syntax diagnostics, or produces syntax-aware chunks for LLMs — in Rust, Python, Node.js/TypeScript, or the ts-pack CLI. Covers installation, the CLI surface, the SDK surface, and parser-cache management.
tree-sitter-language-pack-using-the-mcp-server
Use when parsing source, extracting code structure, or detecting a language through the tree-sitter-language-pack MCP server's tools, rather than shelling out to the ts-pack CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.
tree-sitter-language-pack-parsing-source
Use when the user wants a tree-sitter syntax tree for a source file — an s-expression dump or JSON tree. Covers `ts-pack parse`, language auto-detection vs `--language`, stdin input, and reading `has_errors`.
tree-sitter-language-pack-managing-parsers
Use when the user needs to manage the tree-sitter parser cache — prefetch parsers for offline or CI runs, list what is downloaded, inspect a language, find the cache directory, or clean it. Covers `ts-pack download`, `list`, `info`, `cache-dir`, `clean`, and `init`.
tree-sitter-language-pack-extracting-code-structure
Use when the user wants structured code metadata from a source file — functions, classes, imports, exports, symbols, docstrings, comments, or syntax diagnostics. Covers `ts-pack process` feature flags, the JSON result shape, and the default feature set.
tree-sitter-language-pack-detecting-languages
Use when the user wants to know which programming language a file or snippet is. Covers implicit detection in `ts-pack parse`/`process`, confirming support with `ts-pack list`/`info`, and the SDK detection functions for path, extension, and raw content.