mcp-file-context-server
by bsmi021·★ 36·综合分 43
功能强大的 MCP 服务器,为 LLM 提供文件系统上下文,具有高级缓存和代码分析功能。
file-systemdeveloper-toolsai-llm
6
Forks
3
活跃 Issue
10 个月前
最近提交
2 天前
收录于
概述
该 MCP 服务器使 LLM 能够读取、搜索和分析代码文件,提供全面的文件操作和代码分析工具。它实现了带有 LRU 策略的高级缓存和实时文件监控功能。服务器提供多种工具用于列出文件、读取内容、搜索模式、分析代码质量指标和管理缓存统计,使其在代码审查和理解大型代码库时特别有价值。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
你:在由 LLM 驱动的开发环境中进行代码审查和分析
你:理解复杂项目的文件结构和依赖关系
你:通过自动缓存更新实现实时代码监控
你:支持哪些文件类型?
你:缓存如何工作?
什么时候选它
当您的 LLM 需要全面的文件系统访问和缓存功能时,特别是在开发环境中进行代码分析和实时文件监控,选择这个 MCP 服务器。
什么时候不要选它
如果您需要写入文件权限(此服务器仅支持读取)或需要认证访问受限制的文件系统,请不要选择此方案。
此 server 暴露的工具
从 README 抽取出 5 个工具list_context_files({ path: string, recursive?: boolean, includeHidden?: boolean }) => Promise<{files: Array}>Lists files in a directory with detailed metadata
read_context({ path: string, encoding?: string, maxSize?: number, recursive?: boolean, fileTypes?: string[] }) => Promise<{content: string, metadata: Object}>Reads file or directory contents with metadata
search_context({ pattern: string, path: string, options?: { recursive?: boolean, contextLines?: number, fileTypes?: string[] } }) => Promise<{matches: Array}>Searches for patterns in files with context
analyze_code({ path: string, recursive?: boolean, metrics?: string[] }) => Promise<{analysis: Object}>Analyzes code files for quality metrics
cache_stats({ detailed?: boolean }) => Promise<{stats: Object}>Gets cache statistics and performance metrics
可对比工具
nomic-mcp-embed-textfilesystem-mcpgithub-mcp
安装
通过 Smithery 安装
npx -y @smithery/cli install @bsmi021/mcp-file-context-server --client claude手动安装
npm install @modelcontextprotocol/file-context-serverClaude Desktop 配置
添加到 claude_desktop_config.json:
{
"mcpServers": {
"file-context": {
"command": "npx",
"args": ["file-context-server"]
}
}
}FAQ
- 支持哪些文件类型?
- 服务器支持多种文件编码,并可按文件类型过滤。支持常见的代码文件如 TypeScript、JavaScript,并可以指定自定义文件类型。
- 缓存如何工作?
- 服务器使用 LRU(最近最少使用)缓存策略,当文件更改时会自动使缓存失效。缓存大小和 TTL 可通过环境变量进行配置。
mcp-file-context-server 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。