FileScopeMCP
MCP ServerFree** - Analyzes your codebase identifying important files based on dependency relationships. Generates diagrams and importance scores per file, helping AI assistants understand the codebase. Automatically parses popular programming languages, Python, Lua, C, C++, Rust, Zig.
Capabilities10 decomposed
multi-language dependency graph construction with bidirectional tracking
Medium confidenceParses source code in Python, Lua, C, C++, Rust, and Zig using language-specific import pattern matching (regex-based for each language) to build a bidirectional dependency map. The system constructs a directed graph where nodes are files and edges represent import relationships, enabling traversal of both incoming and outgoing dependencies. Uses buildDependentMap() to resolve import paths and track which files depend on which other files across the entire codebase.
Implements language-agnostic dependency parsing via configurable regex patterns per language (IMPORT_PATTERNS in file-utils.ts) rather than AST parsing, enabling lightweight analysis across 6+ languages without heavy parser dependencies. Tracks bidirectional relationships (both 'depends on' and 'is depended by') in a single pass.
Faster than AST-based tools like Understand or Lattix for initial codebase scans due to regex simplicity, but less accurate for complex import patterns; better suited for AI context generation than enterprise dependency analyzers
file importance scoring with multi-factor ranking algorithm
Medium confidenceCalculates a normalized importance score (0-10) for each file using a weighted combination of factors: dependency count (how many files depend on it), file type heuristics (core files like main.py or index.ts score higher), directory depth (files closer to root are weighted higher), and naming patterns (files matching keywords like 'config', 'utils', 'core' receive boosts). The calculateImportance() function in file-utils.ts combines these signals into a single comparable metric, enabling AI assistants to prioritize which files to analyze first.
Combines dependency-based ranking (graph centrality) with file-type heuristics and naming pattern recognition in a single normalized score, rather than using only dependency counts or only static heuristics. Allows setFileImportance() to override scores manually, enabling human-in-the-loop refinement.
More lightweight than machine-learning-based importance ranking (e.g., using code metrics) but more context-aware than simple dependency counting; designed specifically for AI assistant context prioritization rather than general code metrics
mermaid diagram generation with customizable visualization and filtering
Medium confidenceGenerates interactive Mermaid flowchart diagrams from the dependency graph, with support for customizable node styling, layout algorithms, and filtering options. The MermaidGenerator class in mermaid-generator.ts converts the file dependency graph into Mermaid syntax, applies visual styling based on file importance scores (color intensity, node size), and produces HTML output via createMermaidHtml(). Supports filtering by file type, importance threshold, or specific file patterns to reduce diagram complexity for large codebases.
Integrates importance scores into visual encoding (node color/size reflects file criticality) rather than treating all files equally, making architectural hierarchy immediately visible. Supports dynamic filtering to generate focused diagrams for subsystems without manual graph manipulation.
Simpler and more accessible than GraphViz or Cytoscape for quick visualization, but less powerful for complex layout control; better suited for documentation and AI context than specialized dependency analyzers like Understand
file tree state persistence with multi-project configuration management
Medium confidenceManages persistent storage of file analysis results across multiple independent projects using a configuration-based approach. The storage-utils.ts module provides createFileTreeConfig(), saveFileTree(), and loadFileTree() functions that serialize the complete file tree (nodes, edges, importance scores, metadata) to disk in JSON format. Each project maintains its own configuration file, enabling users to analyze multiple codebases independently and reload previous analyses without re-scanning.
Implements per-project configuration files that store complete analysis state (not just metadata), enabling independent file trees for different project areas. Uses JSON serialization for human-readable configs that can be version-controlled or manually edited.
Simpler than database-backed persistence (no external dependencies) but less queryable; suitable for AI tool integration where config files are preferred over databases
real-time filesystem monitoring with automatic dependency graph updates
Medium confidenceWatches the filesystem for changes (file creation, deletion, modification) using Node.js fs.watch() and automatically updates the dependency graph when files are added or removed. The FileWatcher class in mcp-server.ts implements handleFileEvent() to detect changes, re-analyze affected files, and update the bidirectional dependency map incrementally. This enables the MCP server to maintain a current view of the codebase without requiring manual refresh or full re-scans.
Integrates filesystem monitoring directly into the MCP server lifecycle, automatically updating the dependency graph on file system events rather than requiring explicit refresh calls. Uses incremental re-analysis (only affected files) rather than full re-scans.
More responsive than polling-based approaches but less precise than AST-aware change detection; suitable for AI assistants that need current codebase state without manual refresh
mcp protocol server implementation with tool-based api exposure
Medium confidenceImplements the Model Context Protocol (MCP) specification as a TypeScript server that exposes file analysis capabilities as callable tools. The mcp-server.ts file (lines 297-369, 571-575, 578-1584) defines the MCP server initialization, tool registration, and request/response handling. Tools are registered with JSON schemas describing parameters and return types, enabling AI clients to discover and invoke capabilities like 'analyze_codebase', 'get_file_importance', 'generate_diagram' through standard MCP protocol messages over stdio transport.
Wraps all file analysis capabilities as discoverable MCP tools with JSON schemas, enabling AI clients to understand and invoke them without hardcoding. Uses stdio transport for seamless integration with AI development environments.
More standardized and composable than REST APIs or custom protocols; enables AI assistants to discover and use tools dynamically without pre-configuration
file metadata and summary storage with human-ai annotation support
Medium confidenceStores and retrieves file-level metadata including human-written or AI-generated summaries, descriptions, and custom annotations. The updateFileNode() and getFileNode() functions in storage-utils.ts manage a file node structure that includes not just dependency information but also descriptive text, tags, and custom properties. This enables AI assistants to augment their understanding of files with human-provided context or to store AI-generated summaries for future reference.
Integrates annotation storage directly into the file tree structure rather than as a separate system, enabling metadata to be persisted alongside analysis results. Supports both human-written and AI-generated summaries in the same field.
Simpler than external knowledge bases (no additional dependencies) but less queryable; suitable for lightweight annotation workflows integrated with file analysis
language-specific import pattern matching and path resolution
Medium confidenceImplements language-specific regex patterns to extract import statements from source code and resolve them to actual file paths. For each supported language (Python, Lua, C, C++, Rust, Zig), the system defines IMPORT_PATTERNS that match language-specific import syntax (e.g., 'import X' for Lua, 'from X import Y' for Python, '#include' for C/C++). The resolveImportPath() function in file-utils.ts converts extracted import names to filesystem paths, handling relative imports, package names, and file extensions.
Uses configurable regex patterns per language (IMPORT_PATTERNS in file-utils.ts) rather than language-specific parsers, enabling support for multiple languages without heavyweight dependencies. Patterns are centralized and can be extended for new languages.
Much faster than AST-based parsing for initial scans, but less accurate for complex import patterns; better for breadth (many languages) than depth (complex syntax handling)
codebase scanning and file tree construction from filesystem
Medium confidenceRecursively scans a filesystem directory to discover all source files and build an initial file tree structure. The file analysis processing pipeline (src/mcp-server.ts lines 98-178) walks the directory tree, filters files by extension, and creates file nodes with metadata (path, name, extension, size). This foundational capability enables all downstream analysis by establishing which files exist and their basic properties before dependency analysis begins.
Integrates file discovery directly into the analysis pipeline as the first stage, building a complete file tree before dependency analysis. Supports configurable filtering to exclude build artifacts and dependencies.
Simpler and faster than git-based file discovery but less aware of version control; suitable for analyzing working directories regardless of git status
configuration-driven analysis with project-specific settings
Medium confidenceSupports project-specific configuration files that control analysis behavior including file filters, import patterns, importance weighting, and output options. The createFileTreeConfig() function in storage-utils.ts and Application Configuration section enable users to define which files to analyze, how to weight importance factors, and which languages to support. Configuration is stored in JSON format and can be version-controlled, enabling teams to maintain consistent analysis across environments.
Stores configuration in version-controllable JSON files that can be committed to the repository, enabling teams to maintain consistent analysis settings. Configuration is loaded at server startup and applied to all subsequent analyses.
More flexible than hardcoded defaults but requires manual configuration; suitable for teams that want to customize analysis without code changes
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with FileScopeMCP, ranked by overlap. Discovered automatically through the match graph.
Mermaid
The official Mermaid Editor plugin by the Mermaid open source team, now with AI-powered diagramming! Create, edit and preview diagrams seamlessly within VS Code
CodeViz | Visual codebase maps
Fast codebase understanding and navigation
code-graph-llm
Compact, language-agnostic codebase mapper for LLM token efficiency.
Grit
Automating code migrations and dependency upgrades
code-index-mcp
A Model Context Protocol (MCP) server that helps large language models index, search, and analyze code repositories with minimal setup
AppMap
AI-driven chat with a deep understanding of your code. Build effective solutions using an intuitive chat interface and powerful code visualizations.
Best For
- ✓teams maintaining large codebases with mixed language ecosystems
- ✓developers refactoring legacy code and needing to understand coupling
- ✓AI assistants analyzing unfamiliar projects to prioritize which files to examine first
- ✓AI-assisted code analysis where context is limited and prioritization is critical
- ✓onboarding developers to large projects by highlighting key files
- ✓automated code quality tools that need to focus analysis on important modules
- ✓technical documentation and architecture reviews
- ✓onboarding and knowledge transfer sessions
Known Limitations
- ⚠regex-based pattern matching cannot resolve dynamic imports or conditional requires
- ⚠does not track transitive dependencies through package managers (npm, pip, cargo)
- ⚠relative import resolution may fail with complex path aliasing or monorepo structures
- ⚠no support for circular dependency detection or cycle breaking strategies
- ⚠heuristic-based scoring may not reflect actual architectural importance in unconventional projects
- ⚠naming pattern matching is language and convention-specific (assumes common naming like main.py, index.ts)
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
** - Analyzes your codebase identifying important files based on dependency relationships. Generates diagrams and importance scores per file, helping AI assistants understand the codebase. Automatically parses popular programming languages, Python, Lua, C, C++, Rust, Zig.
Categories
Alternatives to FileScopeMCP
Are you the builder of FileScopeMCP?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →