About this project

Scantool is an MCP (Model Context Protocol) server designed to enhance AI agent interactions with codebases by providing structured analysis rather than raw file dumps. Powered by Tree-sitter, it supports over 20 programming languages, including Python, JavaScript, TypeScript, Rust, Go, C/C++, Java, PHP, C#, Ruby, Zig, Swift, SQL, HTML, CSS, and Markdown. The tool extracts classes, methods, functions, imports, call graphs, and hot functions with exact line numbers, enabling agents to understand code architecture efficiently. Key features include: - **Zero Infrastructure**: No need for indexing, API keys, vector databases, or model downloads. It scans directories on demand. - **Multi-Language Support**: Analyzes both code and documents (Markdown, HTML, CSS, SQL, config) through a unified lens. - **CLI Integration**: Automatically installs an `sct` shell command alongside the MCP server, allowing agents to use the same analysis tools directly in the terminal. This includes commands for scanning, focusing on specific nodes, searching, diffing, and resolving references across git branches. - **Advanced Analysis Tools**: - `preview_directory`: Provides high-level overviews with entry points, import graphs, and hot functions. - `scan_file`: Offers detailed structural analysis with signatures, decorators, and docstrings. Supports a `focus` parameter to read specific nodes verbatim. - `scan_directory`: Generates compact directory trees with inline class/function names. - `search_structures`: Filters code by type, name pattern, decorator, or complexity. - `find_divergence`: Audits directories for functions that break expected call patterns. - **Output Formats**: Supports tree-format visualizations with box-drawing characters and JSON for programmatic use. Output is optimized for LLM consumption with measurable token efficiency improvements over traditional grep-based approaches. - **Compatibility**: Works seamlessly with Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot agent mode), and Cline.