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.
β¨ Instantly understand and visualize your codebase structure & dependencies! β¨
A TypeScript-based tool for ranking files in your codebase by importance, tracking dependencies, and providing summaries to help understand code structure.
This MCP server analyzes your codebase to identify the most important files based on dependency relationships. It generates importance scores (0-10) for each file, tracks bidirectional dependencies, and allows you to add custom summaries for files. All this information is made available to AI tools through Cursor's Model Context Protocol.
π Supercharge your Code Understanding! FileScopeMCP provides insights directly to your AI assistant:
π― File Importance Analysis
π Dependency Tracking
π Visualization
π File Summaries
π Multiple Project Support
πΎ Persistent Storage
Clone this repository
Build the project:
The build script will install all node dependencies and generate mcp.json for you.
Windows:
build.bat
Copy the generated mcp.json configuration to your project's .cursor
directory:
{
"mcpServers": {
"FileScopeMCP": {
"command": "node",
"args": ["<build script sets this>/mcp-server.js","--base-dir=C:/Users/admica/my/project/base"],
"transport": "stdio",
"disabled": false,
"alwaysAllow": []
}
}
}
Linux: (Cursor in Windows, but your project is in Linux WSL, then put the MCP in Linux and build)
build.sh
{
"mcpServers": {
"FileScopeMCP": {
"command": "wsl",
"args": ["-d", "Ubuntu-24.04", "/home/admica/FileScopeMCP/run.sh"],
"transport": "stdio",
"disabled": false,
"alwaysAllow": []
}
}
}
Update the arg path --base-dir to your project's base path.
The tool scans source code for import statements and other language-specific patterns:
import
and from ... import
statementsimport
statements and require()
calls#include
directivesuse
and mod
statementsrequire
statements@import
directivesFiles are assigned importance scores (0-10) based on a weighted formula that considers:
src/
are weighted higher)A file that is central to the codebase (imported by many files) will have a higher score.
The system uses a three-phase approach to generate valid Mermaid syntax:
This ensures all diagrams have valid syntax and render correctly. HTML output includes:
The system handles various path formats to ensure consistent file identification:
All file tree data is stored in JSON files with the following structure:
The MCP server exposes the following tools:
.mmd
) or HTML with embedded renderingThe easiest way to get started is to enable this mcp in cursor and tell cursor to figure it out and use it. As soon as the mcp starts, it builds an initial json tree. Tell an LLM to make summaries of all your important files and use the mcp's set_file_summary to add them.
Create a file tree for your project:
create_file_tree(filename: "my-project.json", baseDirectory: "/path/to/project")
Find the most important files:
find_important_files(limit: 5, minImportance: 5)
Get detailed information about a specific file:
get_file_importance(filepath: "/path/to/project/src/main.ts")
Read a file's content to understand it:
read_file_content(filepath: "/path/to/project/src/main.ts")
Add a summary to the file:
set_file_summary(filepath: "/path/to/project/src/main.ts", summary: "Main entry point that initializes the application, sets up routing, and starts the server.")
Retrieve the summary later:
get_file_summary(filepath: "/path/to/project/src/main.ts")
Create a basic project structure diagram:
generate_diagram(style: "directory", maxDepth: 3, outputPath: "diagrams/project-structure", outputFormat: "mmd")
Generate an HTML diagram with dependency relationships:
generate_diagram(style: "hybrid", maxDepth: 2, minImportance: 5, showDependencies: true, outputPath: "diagrams/important-files", outputFormat: "html")
Customize the diagram layout:
generate_diagram(style: "dependency", layout: { direction: "LR", nodeSpacing: 50, rankSpacing: 70 }, outputPath: "diagrams/dependencies", outputFormat: "html")
Enable file watching for your project:
toggle_file_watching()
Check the current file watching status:
get_file_watching_status()
Update file watching configuration:
update_file_watching_config(config: {
debounceMs: 500,
autoRebuildTree: true,
watchForNewFiles: true,
watchForDeleted: true,
watchForChanged: true
})
This project is licensed under the GNU General Public License v3 (GPL-3.0). See the LICENSE file for the full license text.
Retrieving and analyzing issues from Sentry.io
Create crafted UI components inspired by the best 21st.dev design engineers.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMaticβs API.
Flag features, manage company data, and control feature access using Bucket
Enable AI Agents to fix build failures from CircleCI.
Query and analyze your Opik logs, traces, prompts and all other telemtry data from your LLMs in natural language.
Run code in secure sandboxes hosted by E2B
Tool platform by IBM to build, test and deploy tools for any data source
Run Python in a code sandbox.