目录树可视化工具

MCP Tree Explorer 是一个轻量级的目录树可视化工具,支持智能过滤常见大型目录(如 node_modules、.git 等),并可在 Cursor 中集成使用。

  • by carterlasalle
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 carterlasalle/directory_structure_mcp

使用说明

MCP树资源管理器

用于Cursor中目录树可视化的轻量级MCP工具。

特性

  • 使用可视化工具可视化目录结构 tree 命令
  • 智能过滤常见的大目录(node_modules、.git等)
  • 可定制的忽略和保留模式
  • 自动安装 tree 命令(如果不可用)
  • 适用于Windows、macOS和Linux

安装

# Using pip
pip install mcp-tree-explorer

# Using uv
uv pip install mcp-tree-explorer

使用游标

通过编辑Cursor配置文件配置Cursor以使用此工具:

{
  "tools": {
    "mcp-tree-explorer": {
      "command": "mcp-tree-explorer"
    }
  }
}

刀具参数

这 project_tree 工具接受以下参数:

  • directory:要检查的目录(默认:当前目录)
  • depth:树的最大深度(可选,如果未指定,则不受限制)
  • ignore:要忽略的其他模式,逗号分隔(可选)
  • keep:即使与自动忽略模式匹配,也要保留模式,逗号分隔(可选)

Cursor中的示例用法:

  • “显示此项目的目录结构”
  • “在src目录中运行树,但包含node_modules”
  • 显示项目树,忽略测试文件,但保留dist文件夹

发展

# Clone the repository
git clone https://github.com/yourusername/mcp-tree-explorer.git
cd mcp-tree-explorer

# Install in development mode
uv pip install -e .

许可证

麻省理工学院