npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

filegraph-mcp

v0.1.0

Published

文件映射关系知识图谱MCP服务器

Readme

文件知识图谱MCP服务器

一个轻量级的文件映射关系知识图谱MCP服务器,帮助智能体理解和管理文件系统中的文件关系。

功能特性

🔍 智能搜索

  • 全局语义搜索: 根据关键词、文件名或内容查找文件
  • 跨文件夹关联: 发现分散在不同文件夹中的相关文件
  • 主题搜索: 按主题(AI、编程、文档等)搜索文件
  • 模糊搜索: 支持不精确的文件名匹配

🔗 关系发现

  • 文件关系分析: 自动分析文件间的相似性和关联性
  • 跨文件夹链接: 发现跨文件夹的文件关联
  • 智能分类: 基于文件名、内容、时间等维度进行文件分类

📁 文件系统监控

  • 全驱动器扫描: 扫描所有驱动器(包括U盘)
  • 实时监控: 监控文件变化和可移动设备
  • 增量更新: 支持增量索引更新

安装和使用

1. 安装依赖

npm install

2. 构建项目

npm run build

3. 启动服务器

npm start

4. 开发模式

npm run dev

MCP工具列表

文件系统工具

  • scan_all_drives - 扫描所有驱动器
  • monitor_removable_devices - 监控可移动设备
  • sync_knowledge_graph - 同步知识图谱
  • get_scan_status - 获取扫描状态

搜索工具

  • global_semantic_search - 全局语义搜索
  • find_related_files_across_folders - 跨文件夹查找相关文件
  • search_by_topic - 按主题搜索
  • find_file - 根据文件名查找文件
  • get_file_info - 获取文件详细信息

关系工具

  • analyze_file_relationships - 分析文件关系
  • discover_cross_folder_links - 发现跨文件夹关联
  • get_file_relationships - 获取文件关系
  • get_relationship_analysis - 获取关系分析报告

使用示例

扫描所有驱动器

{
  "name": "scan_all_drives",
  "arguments": {
    "excludePatterns": ["node_modules", ".git"],
    "maxFileSize": 104857600
  }
}

全局语义搜索

{
  "name": "global_semantic_search",
  "arguments": {
    "query": "AI研究报告",
    "limit": 10,
    "searchType": "hybrid"
  }
}

分析文件关系

{
  "name": "analyze_file_relationships",
  "arguments": {
    "folderPath": "/path/to/folder",
    "similarityThreshold": 0.7
  }
}

配置说明

配置文件 config.json 包含以下设置:

  • database: 数据库配置
  • scanning: 扫描设置(排除模式、文件大小限制等)
  • search: 搜索配置(默认限制、最小分数等)
  • relationships: 关系分析配置
  • monitoring: 监控设置
  • performance: 性能优化设置

技术架构

核心组件

  • FileKnowledgeDatabase: SQLite数据库存储
  • FileScanner: 文件系统扫描器
  • SemanticSearchEngine: 语义搜索引擎
  • RelationshipFinder: 关系发现算法

技术栈

  • TypeScript: 类型安全的JavaScript
  • SQLite: 轻量级数据库
  • Fuse.js: 模糊搜索
  • Natural: 自然语言处理
  • Chokidar: 文件系统监控

性能指标

  • 扫描速度: 10,000文件/分钟
  • 搜索响应: <100ms(10万文件)
  • 内存占用: 200MB(10万文件)
  • 启动时间: <5秒

开发计划

  • [x] 基础文件扫描和索引
  • [x] 语义搜索引擎
  • [x] 关系发现算法
  • [x] MCP工具接口
  • [ ] 用户模式学习
  • [ ] 智能建议系统
  • [ ] 高级语义搜索
  • [ ] 文件组织建议

许可证

MIT License

贡献

欢迎提交Issue和Pull Request!