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

mdfiles-mcp

v1.0.1

Published

MCP Server for mdFiles document management system

Readme

mdFiles MCP Server

mdFiles 文档管理系统的 Model Context Protocol (MCP) Server,使 Claude Code、Cursor 等 AI 工具可以原生集成读写 mdFiles 中的文档。

功能

  • 浏览项目空间、文件夹和文件树
  • 读取文件最新内容(草稿版本)
  • 创建和更新 Markdown 文件
  • 增量更新文件章节(替换、追加、前置、追加到节)
  • 搜索文档(按关键词、标签、空间过滤)

安装

本地开发

cd mdFiles-mcp
npm install
npm run build

通过 npx 运行(无需安装)

MDFILES_API_URL=https://your-domain.com MDFILES_API_KEY=mdf_xxx npx mdfiles-mcp

全局安装

npm install -g mdfiles-mcp

配置

通过环境变量配置:

| 环境变量 | 说明 | 示例 | |---------|------|------| | MDFILES_API_URL | mdFiles 后端 API 地址,需包含后端 context path | https://api-mdf.kuaidianhao.com/api/v1 | | MDFILES_API_KEY | 开放 API Key | mdf_A3kR9mXpQzLvBn7cYeWd2TsUfGhIoJa |

注意:不要填写前端站点地址(例如 https://mdf.kuaidianhao.com)。MCP 需要访问后端开放接口,完整请求会拼接为 ${MDFILES_API_URL}/open/v1/...

API Key 由系统管理员在 mdFiles 后台创建,需具备相应 Scope 权限。

AI 工具配置

Claude Code

~/.claude/settings.json 或项目 .claude/settings.local.json 中添加:

{
  "mcpServers": {
    "mdfiles": {
      "command": "node",
      "args": ["/absolute/path/to/mdFiles-mcp/dist/index.js"],
      "env": {
        "MDFILES_API_URL": "https://api-mdf.kuaidianhao.com/api/v1",
        "MDFILES_API_KEY": "mdf_xxxxxxxx"
      }
    }
  }
}

Cursor

在 Cursor Settings -> Features -> MCP Servers 中添加:

  • Type: stdio
  • Command: node /absolute/path/to/mdFiles-mcp/dist/index.js
  • Environment Variables:
    • MDFILES_API_URL=https://your-domain.com
    • MDFILES_API_KEY=mdf_xxxxxxxx

Claude Desktop

在配置文件中添加(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mdfiles": {
      "command": "node",
      "args": ["/absolute/path/to/mdFiles-mcp/dist/index.js"],
      "env": {
        "MDFILES_API_URL": "https://your-domain.com",
        "MDFILES_API_KEY": "mdf_xxxxxxxx"
      }
    }
  }
}

可用 Tools

| Tool | 描述 | 参数 | |------|------|------| | list_spaces | 列出所有可访问的项目空间 | 无 | | list_folders | 列出指定空间下的文件夹树形结构 | spaceId: string | | list_files | 列出指定文件夹下的文件 | folderId: string | | read_file | 读取文件的最新内容(草稿版本) | fileId: string | | write_file | 更新文件内容(自动创建新版本) | fileId: string, content: string, description?: string | | create_file | 在指定文件夹中创建新的 Markdown 文件 | folderId: string, name: string, content: string | | patch_section | 增量更新文件的指定章节 | fileId: string, mode: string, content: string, sectionHeading?: string | | search_docs | 搜索文档 | keyword?: string, tagId?: string, spaceId?: string |

patch_section 模式说明

  • replace_section:替换指定章节的完整内容(需提供 sectionHeading
  • append:在文件末尾追加内容
  • prepend:在文件开头插入内容
  • append_to_section:追加到指定章节末尾(需提供 sectionHeading

使用示例

列出所有空间:

> 请列出我可以访问的项目空间

读取文件:

> 读取文件 ID 为 9876543210 的内容

更新文件:

> 将文件 9876543210 的内容更新为 "# 新标题\n\n这是新内容"

创建文件:

> 在文件夹 444555666 中创建一个名为 "需求文档.md" 的文件,内容是 "# 需求概述"

搜索文档:

> 搜索包含 "API 设计" 的文档

技术栈

后端接口

MCP Server 本质上是 mdFiles 后端 /open/v1 开放接口的客户端封装。详见后端 OPEN-API-GUIDE.md

License

MIT