local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Respects .gitignore patterns to exclude files and directories according to Git's ignore rules when generating the file tree.
MCP 源树服务器
这是一个在指定目录下生成文件树的 MCP 服务器。根据以 开头的目录排除特定的文件或目录.
或.gitignore
中列出的条件。与 Claude 集成可以让 Claude 快速查看项目结构并帮助他确定要编辑的文件。
功能
- 以 JSON 格式获取指定目录下的文件树。
- 根据
.gitignore
条件排除文件/目录 - 将目录结构表示为分层 JSON
设置
先决条件
- Python 3.10 或更高版本
- 紫外线
安装
Copy
Claude 用于桌面设置
将以下内容添加到claude_desktop_config.json
:
Copy
Claude 使用示例
请指定 src 上一级的根目录。当考虑.gitignore
时,假定.gitignore
直接存在于根目录下。 /Users/xxx/GitHub/xxx/ のソースツリーを確認してください
,它将会起作用。
其回应如下:
Copy
这使得 Claude 能够快速了解项目结构。
文件排除
以 开头的目录.
将被自动排除。与.gitignore
中的模式匹配的文件和目录将自动从树中排除。例如,以下.gitignore
配置是有效的:
Copy
You must be authenticated.
Tools
从指定目录的“src”文件夹生成 JSON 文件树,遵守“.gitignore”规则,以便在 Claude 中快速审查项目结构。