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

Code Tree

MCP Server

code-tree 是一个 CLI 工具和 MCP 服务器,用于快速浏览项目结构和代码库,支持目录结构扫描、代码符号提取和多种编程语言的 AST 解析。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
代码分析命令行工具TypeScriptClaudeClaude

安装说明

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

作者 / 组织

febalist

提供方

febalist

最后核验

2026/5/17 20:23

快速接入

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

详细介绍

代码树

](https://www.npmjs.com/package/@febalist/code-tree) ![CI](https://github.com/febalist/code-tree/actions/workflows/ci.yml)

一个CLI工具和MCP服务器,用于快速探索项目结构和代码库。

要求: 包子

特性

  • 🌳 目录结构扫描(如 tree)
  • 🔍 代码符号提取:类、函数、接口、类型
  • 📝 文档注释支持
  • 🚀 通过Tree sitter(WASM)进行精确的AST解析
  • 🎯 10+编程语言+Markdown
  • ⚡ 自动输出优化

安装

# Global installation
bun add -g @febalist/code-tree

# Or use with bunx (no installation needed)
bunx @febalist/code-tree .

用法

# Scan current directory
code-tree .

# Scan specific directory
code-tree src/

# Parse specific file
code-tree src/index.ts

# Multiple paths
code-tree src/ lib/

# With options
code-tree --depth 2 --no-symbols .
code-tree --ignore "*.test.ts" --ignore "*.spec.ts" src/

# Help
code-tree --help

参数

  • 位置参数:目录或文件的路径(默认值: .)
  • --depth :最大遍历深度(默认值:10)
  • --symbols / --no-symbols:包含/排除代码符号(默认:自动)
  • --comments / --no-comments:包括/排除文档注释(默认:自动)
  • `--ignore

`:其他忽略模式(可重复)

输出示例

带符号的目录:

src/
├── index.ts
│     async run(args)
├── parser/
│   ├── index.ts
│   │     class ParserManager
│   │       async init()
│   │       private async loadLanguage(config: LanguageConfig): Promise
│   │       async parseFile(filePath: string): Promise
│   └── types.ts
│         type SymbolKind
│         interface CodeSymbol
│         interface FileSymbols

详细分类文件:

src/parser/index.ts

  class ParserManager
    async init()
      locateFile()
    private async loadLanguage(config: LanguageConfig): Promise
    async parseFile(filePath: string): Promise

支持的语言

  • TypeScript(.ts、.tsx)
  • JavaScript(.js、.jsx、.mjs、.cjs)
  • Python(.py、.pyw)
  • 去(.去)
  • PHP(.PHP)
  • 锈蚀(.rs)
  • Java(.Java)
  • C#(.cs)
  • Ruby(.rb)
  • Kotlin(.kt,.kts)
  • Swift(.Swift)
  • C/C++(.C、.h、.cpp、.hpp、.cc、.cxx、.hh、.hxx)
  • Markdown(.md、.mdx)

文件忽略

自动忽略:

  • .git, .svn, .hg, .DS_Store (总是)
  • node_modules, vendor, dist, build, __pycache__, venv, target, bin, obj, coverage
  • 图案来自 .gitignore
  • 通过以下方式定制图案 --ignore 参数

MCP服务器

code-tree 还提供了一个MCP(模型上下文协议)服务器,用于与Claude Code等LLM客户端集成。

MCP服务器公开了与CLI相同的功能和参数。

集成示例

添加到克劳德代码MCP配置:

{
  "mcpServers": {
    "code-tree": {
      "command": "bunx",
      "args": ["@febalist/code-tree", "mcp"]
    }
  }
}

目录标签

目录标签

代码分析命令行工具TypeScriptClaude本地部署项目结构AST解析多语言支持CLI工具

支持客户端

Claude

接入字段

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

未说明

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

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明none部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP