Get the FREE Ultimate OpenClaw Setup Guide →

file-scanner

MCP server for code structure analysis across 20+ languages. Tree-sitter powered. Works with Claude Code and Claude Desktop.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Install uv (which provides the uvx command):

    After installing, restart your terminal to ensure uvx is on PATH.

  2. 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
  3. 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).
  4. 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"] } } }
  5. 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

Sponsor this space

Reach thousands of developers