An MCP (Model Context Protocol) server that provides file and directory tools for LLMs, with built-in support for respecting .gitignore patterns.
- project_structure: Generates a tree view of directory structures while respecting
.gitignorepatterns - read_multiple_files: Reads multiple files in a single request with clear content separation
- project://info: Comprehensive project information (type, dependencies, scripts, git status)
- git://status: Detailed git repository status with file changes and recent commits
- dependencies://list: Lists all project dependencies by package manager
- config://list: Finds and lists all configuration files in the project
- files://recent: Shows the 20 most recently modified files
- context://full: Complete project context with directory structure and all text files under 50KB
- Handles circular symlinks and permission errors gracefully
- Supports depth limiting and hidden file visibility options
- Clear error messages with helpful context for path issues
-
Install the server to Claude Desktop:
uv run mcp install main.py --name "File Tools" -
Restart Claude Desktop
- Clone the repository
- Install dependencies:
uv sync
uv run mcp dev main.pyThis opens the MCP Inspector for debugging and testing.
uv run python main.pyRuns the server in stdio mode, waiting for MCP client connections.
uv run python test_client.pyRuns a test client to verify server functionality.
Generates a tree view of a directory structure while respecting .gitignore patterns.
Parameters:
path(str, optional): Directory path to analyze (default: current working directory)max_depth(int, optional): Maximum depth to traverse (default: None for unlimited)show_hidden(bool, optional): Include hidden files and directories (default: False)
Example:
# Get structure of current directory
result = await session.call_tool("project_structure", {})
# Get structure with depth limit
result = await session.call_tool("project_structure", {
"path": "/path/to/project",
"max_depth": 3
})
# Include hidden files
result = await session.call_tool("project_structure", {
"show_hidden": True
})Reads multiple files and returns their contents in a single response.
Parameters:
paths(list[str], required): List of file paths to read
Features:
- Clear separation between files with headers showing path and size
- Graceful error handling for missing or inaccessible files
- Efficient for reading multiple files in one request
Example:
# Read multiple files
result = await session.call_tool("read_multiple_files", {
"paths": [
"src/main.py",
"config.json",
"README.md"
]
})Provides comprehensive project information in one request:
- Project type detection (Node.js, Python, Rust, etc.)
- Package metadata (name, version, description)
- Available scripts/commands
- Dependency counts
- Git status summary
- Recent commits
Detailed git repository status:
- Current branch and tracking information
- Ahead/behind status with remote
- Staged, modified, and untracked files
- Last 10 commits
Lists all project dependencies:
- Supports npm, yarn, pnpm, pip, poetry, uv
- Shows production and development dependencies
- Handles multiple package manager formats
Finds all configuration files:
- Environment files (.env)
- Language configs (tsconfig.json, pyproject.toml)
- Linters and formatters
- CI/CD configurations
- Editor settings
Shows recently modified files:
- 20 most recently modified files
- File modification timestamps
- File sizes
- Excludes common ignore patterns
Complete project context in one request:
- Full directory structure
- Contents of all text files under 50KB
- Respects .gitignore patterns
- Skips binary files automatically
- Provides summary of files included/skipped
- Perfect for giving LLMs complete project understanding
When using the MCP Inspector or other MCP clients, you may need to configure root paths to allow the server to access your project directories. This is a security feature that prevents unauthorized file access.
In the MCP Inspector:
- Click on the server configuration
- Add root paths for directories you want to access
- Example:
/home/user/projects/my-project
Without proper root paths configured, you may see "File not found" errors even for files that exist.
When deploying this server:
- Bind to localhost (127.0.0.1) only for local deployments
- Use proper authentication if exposing to network
- Consider path traversal risks - the server allows reading any accessible directory
- Configure root paths to limit file access to specific directories
MIT