file-scanner
MCP server for code structure analysis across 20+ languages. Tree-sitter powered. Works with Claude Code and Claude Desktop.
claude mcp add --transport stdio mariusei-file-scanner-mcp uvx scantool \ --env PATH="Ensure uvx is on PATH (from uv install)"
How to use
This MCP server, named scantool in the config, analyzes codebases to extract structure across many languages using tree-sitter. It provides capabilities such as preview_directory for a holistic codebase overview (entry points, import graphs, call graphs, and hot functions), scan_file for detailed per-file signatures and metadata, scan_directory for a compact directory overview with inline names, and search_structures/list_directories for targeted queries and navigation. The output is available in both a human-friendly tree format and a machine-friendly JSON format, which makes it suitable for Claude products, other Claude tools, or any Model Context Protocol client.
To use the tools, send the appropriate command through the MCP transport exposed by the upstream client (e.g., Claude Code, Claude Desktop). For example, a Claude Code setup typically runs: claude mcp add scantool -- uvx scantool, which connects via uvx to the scantool MCP server. You can then invoke the core capabilities via the provided APIs or commands, such as preview_directory for a full analysis of a directory, scan_file for a single file, scan_directory for a directory-wide overview, and search_structures to filter by type, name pattern, or decorator. The server can analyze Python, JavaScript/TypeScript, Rust, Go, C/C++, Java, PHP, C#, Ruby, Zig, Swift, SQL variants, HTML/CSS, Markdown, and more, returning structured results with precise line numbers and signatures.
How to install
Prerequisites:
- A supported runtime (Python with uv requires uv; Node is not needed for this MCP server).
- Access to the uv installer as described in the readme (for uvx, the uv package manager must be installed and available on PATH).
- curl or a network-enabled environment to fetch install scripts when using uv/uvx.
Install steps:
-
Install uv (which provides the uvx command):
- macOS / Linux / WSL: curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows (PowerShell): powershell -ExecutionPolicy ByPass -c " irm https://astral.sh/uv/install.ps1 | iex "
After installing, restart your terminal to ensure uvx is on PATH.
-
Ensure uvx is on PATH (if not auto-detected):
- Linux / WSL: export PATH="$HOME/.local/bin:$PATH"
- macOS: export PATH="$HOME/.local/bin:$PATH"
- Verify: uvx --version
-
Install or run the MCP server from source or package (depending on your preference):
- If using the published MCP, configure it to be started via uvx scantool as per the config example.
- If cloning the repository, you can sync and run as documented in the project (the exact commands depend on the repository authors’ setup).
-
Register the MCP with your Claude product ( Claude Code / Claude Desktop ) using the provided configuration example:
- Claude Code: claude mcp add scantool -- uvx scantool
- Claude Desktop: Use the following config in claude_desktop_config.json: { "mcpServers": { "scantool": { "command": "uvx", "args": ["scantool"] } } }
-
Restart the client applications after adding the MCP server so they can discover and connect to scantool.
Additional notes
Notes and tips:
- The scantool MCP supports 20+ languages via tree-sitter and can extract classes, functions, imports, call graphs, and hot functions with precise line numbers.
- Typical outputs include preview_directory (biggest feature for codebase analysis), scan_file (detailed file view), scan_directory (compact directory overview), and search_structures/list_directories for targeted queries.
- If uvx is not found after installation, ensure the PATH is updated in your terminal session, or add export PATH="$HOME/.local/bin:$PATH" to your shell startup file.
- The recommended server name in configurations is scantool, as shown in examples like uvx scantool or the .mcp.json templates.
- The MCP server relies on the uvx transport; if you switch to a different transport, update the command and args accordingly in the mcp_config.
- For best results, run scans with reasonable limits (e.g., max_files, max_entries) to avoid long analysis times on very large repos.
Related MCP Servers
code-graph-rag
The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
mcp -tree-sitter
MCP Server for Tree-sitter
sandboxed.sh
Self-hosted orchestrator for AI autonomous agents. Run Claude Code & Open Code in isolated linux workspaces. Manage your skills, configs and encrypted secrets with a git repo.
claude-code-open
Open source AI coding platform with Web IDE, multi-agent system, 37+ tools, MCP protocol. MIT licensed.
mcp-gm
wanna develop an app ❓
mcp-ragex
MCP server for intelligent code search: semantic (RAG), symbolic (tree-sitter), and regex (ripgrep) search modes. Built for Claude Code and AI coding assistants.