token-scope-mcp
TokenScope is a Model Context Protocol (MCP) server designed to help Large Language Models (LLMs) efficiently explore and understand codebases and directory structures.
TokenScope provides intelligent directory structure analysis and token-aware file content exploration designed for LLMs like Claude. It helps LLMs understand codebases by exploring directory structures with token-aware summarization, viewing file contents with token limitations in mind, and generating comprehensive reports about directories. TokenScope is particularly useful for managing large codebases, ensuring that LLMs can access and process relevant information without exceeding token limits. It includes features like automatic summarization, smart filtering, and accurate directory statistics, making it a powerful tool for developers working with extensive code repositories.
Features
- Token-Aware Directory Exploration: Automatic summarization for large directories while showing small directories in full, respecting token limits to maximize useful information within constraints.
- Built-in Security: Includes base path validation to ensure all file operations are restricted to a specified directory.
- Smart Filtering: Supports default patterns and .gitignore for filtering out irrelevant files and directories.
- Accurate Directory Statistics: Provides quick scan and full directory statistics for even the largest directories.
Tools
explore_directory
Scan and understand directory structures.
view_content
Access file contents with token awareness.
generate_report
Create comprehensive reports with an option to save to file.