FileScopeMCP
FileScopeMCP
你的 AI 已经知道如何编程。现在它也了解你的代码库了。
FileScopeMCP 会监视你的代码,根据重要性对每个文件进行排名,映射所有依赖关系,并在后台保持 AI 生成的摘要处于最新状态。当你的 LLM 询问“这个文件是做什么的?”时,它无需读取源代码即可获得准确的答案。
适用于 Claude Code、Cursor AI,或作为独立守护进程运行。开箱即支持 12 种语言。
主要功能
重要性排名 — 每个文件的评分范围为 0-10,基于有多少内容依赖于它、它导出了什么以及它所处的位置。你的 LLM 会优先看到关键文件。
依赖映射 — 支持 Python、JS/TS、C/C++、Rust、Go、Ruby、Lua、Zig、PHP、C#、Java 的双向导入跟踪。还能发现循环依赖。
始终保持最新 — 文件监视器 + 语义变更检测意味着元数据会自动更新。针对 TS/JS 进行 AST 级差异分析,对其他语言则使用 LLM 驱动的分析。仅重新处理实际发生变更的部分。
LLM 代理 — 后台进程通过 llama.cpp 的 llama-server(或任何兼容 OpenAI 的 HTTP API)协调所有 AI 工作。优先级队列确保交互式查询优先于后台处理。可在单 GPU 上运行。
Nexus 仪表板 — 一个位于 localhost:1234 的 Web UI,让你可以在所有仓库中直观地探索代码库。包括交互式依赖图、文件详情面板、实时代理活动以及各仓库的健康监控。
Related MCP server: GonMCPtool
快速入门
git clone https://github.com/admica/FileScopeMCP.git
cd FileScopeMCP
./build.sh # installs deps, compiles, registers with Claude Code就是这样。在任何项目中打开 Claude Code 会话,FileScopeMCP 就会自动初始化。尝试:
find_important_files(limit: 5)
status()需要 AI 摘要吗? 运行 ./setup-llm.sh 获取针对特定平台的 llama.cpp llama-server 设置指南 — 详情请参阅 docs/llm-setup.md。如果不设置,其他功能依然可以正常工作。
添加到项目的 .gitignore 中:
.filescope/
.filescope-daemon.logMCP 工具
工具 | 功能 |
| 按重要性评分排序的顶级文件 |
| 关于文件的所有信息:摘要、概念、变更影响、依赖、陈旧度 |
| 带有重要性标记的完整文件树 |
| 查找循环依赖链 |
| 代理连接、队列深度、LLM 进度、监视器状态 |
| 将整个代码库加入 LLM 处理队列 |
| 指向不同的项目 |
| 手动覆盖 |
| 从跟踪中排除文件/模式 |
| 涉及特定文件的循环 |
Nexus 仪表板
npm run nexus # opens at http://localhost:1234一个只读的 Web 仪表板,连接到你机器上的每个 FileScopeMCP 仓库:
项目视图 — 带有重要性热力颜色和陈旧度指示器的文件树,点击任何文件即可查看完整元数据
依赖图 — 交互式 Cytoscape.js 可视化,支持按目录过滤,点击节点进行检查
系统视图 — 实时代理状态、每个仓库的 Token 使用量、流式活动日志
设置 — 管理显示的仓库,从黑名单中移除或恢复
通过扫描 .filescope/data.db 目录自动发现仓库。无需配置。
工作原理
Your code changes
→ file watcher picks it up
→ AST diff classifies the change (exports? types? body only?)
→ importance scores recalculated
→ staleness cascades to dependents (only if exports/types changed)
→ LLM broker regenerates summaries, concepts, change impact
→ your AI's next query gets fresh answers所有内容都存储在每个项目的 .filescope/data.db(SQLite,WAL 模式)中。代理通过 ~/.filescope/broker.sock 的 Unix 套接字协调所有仓库的 LLM 工作。
文档
文档 | 内容 |
llama.cpp / llama-server 安装 — 本地、WSL2+Windows 或远程 | |
项目级配置、代理配置、忽略模式 | |
Claude Code、Cursor AI、守护进程模式的设置 | |
常见问题及修复 | |
依赖检测、重要性公式、级联引擎、存储 |
许可证
Copyright (c) 2026 admica. 保留所有权利。请参阅 LICENSE。
Available Tools
14 toolscreate_file_treeC
Create or load a file tree configuration
Inputs: baseDirectory (required), filename (required).
debug_list_all_filesB
List all file paths in the current file tree
delete_file_treeC
Delete a file tree configuration
Inputs: filename (required).
find_important_filesC
Find the most important files in the project
Inputs: limit, minImportance.
generate_diagramC
Generate a Mermaid diagram for the current file tree
Inputs: style (required), layout, maxDepth, minImportance, +3 more.
get_file_importanceC
Get the importance ranking of a specific file
Inputs: filepath (required).
get_file_summaryC
Get the summary of a specific file
Inputs: filepath (required).
list_filesB
List all files in the project with their importance rankings
list_saved_treesB
List all saved file trees
read_file_contentC
Read the content of a specific file
Inputs: filepath (required).
recalculate_importanceB
Recalculate importance values for all files based on dependencies
select_file_treeC
Select an existing file tree to work with
Inputs: filename (required).
set_file_importanceC
Manually set the importance ranking of a specific file
Inputs: filepath (required), importance (required).
set_file_summaryC
Set the summary of a specific file
Inputs: filepath (required), summary (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Every tool has a clearly distinct purpose with no ambiguity. Tools like 'create_file_tree', 'delete_file_tree', and 'select_file_tree' handle tree management, while 'read_file_content', 'get_file_summary', and 'set_file_summary' focus on file content operations. The separation between listing functions ('debug_list_all_files', 'list_files', 'list_saved_trees') and importance calculations ('get_file_importance', 'set_file_importance', 'recalculate_importance') is well-defined, preventing misselection.
All tool names follow a consistent verb_noun pattern with snake_case throughout. Verbs like 'create', 'delete', 'list', 'get', 'set', 'read', 'find', 'generate', 'select', and 'recalculate' are used predictably with corresponding nouns. There are no deviations in naming conventions, making the tool set highly readable and predictable.
With 14 tools, the count is well-scoped for managing file trees and analyzing file importance in a project. Each tool earns its place by covering distinct aspects such as tree configuration, file listing, content access, importance ranking, and diagram generation. This number is neither too sparse nor overwhelming, fitting the server's purpose effectively.
The tool surface provides complete CRUD/lifecycle coverage for file tree management and file analysis. It includes creation, selection, listing, and deletion of trees, along with operations for reading, summarizing, and setting importance for files. Tools like 'recalculate_importance' and 'generate_diagram' add advanced functionality, leaving no obvious gaps that would cause agent failures in this domain.
Maintenance
Related MCP Connectors
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Related MCP Servers
- FlicenseBqualityDmaintenanceA Model Context Protocol server that helps AI code editors locate TypeScript symbol definitions in codebases, particularly useful for finding original definitions of imported symbols and classes.1-
- AlicenseCqualityDmaintenanceA TypeScript-based Model Context Protocol toolkit that enables AI to interact with code files, manage translations, build projects, and search for files and code content.335MIT
- AlicenseNot gradedqualityDmaintenanceA structural codebase indexer that exposes 18 tools via the Model Context Protocol for AI-assisted code navigation, enabling efficient querying of functions, classes, dependencies, and call chains without reading entire files.281 PyPI63AGPL 3.0
- AlicenseNot gradedqualityFmaintenanceEnables Claude Code to query a TypeScript dependency graph and retrieve the minimal set of files needed for code review, implementation, or debugging.MIT