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

pit-docs-mcp

v1.0.2

Published

MCP server for pitBusinessUi, pitElementUi, and pitBusinessUtils internal Vue component documentation

Readme

PIT Docs MCP Server

MCP (Model Context Protocol) 服务,用于将公司内部的 Vue 组件文档和规范文档暴露给 AI,使其在编写前端代码时能够参考内部最佳实践和 API 规范。

pit-xxxel-xxx 为内部私有组件,互联网上无任何官方文档,此 MCP 是查询其用法、Props、Events、Slots 的唯一途径

功能

  1. Tools(工具):提供 4 个工具供 AI 查询组件文档和代码生成规范。
  2. Resources(Resource Templates):通过 pit-docs:/// URI 将文档作为只读资源暴露。
  3. Prompts(提示):提供 2 个 Prompt,引导 AI 正确使用 pit 组件及生成后台管理页面。

支持的库

| 库名 | 说明 | |-----|------| | pitBusinessUi | 业务组件(如 pit-table、pit-dic、pit-document-preview) | | pitElementUi | 基础 UI 组件(如 el-form-base、el-upload-table) | | pitBusinessUtils | 工具函数(如 formValidate、auth、request) |

工具说明

search_docs

在文档中按关键字搜索。涉及任何 pit-xxx 或 el-xxx 组件时,必须先调用此工具

| 参数 | 类型 | 默认 | 说明 | |-----|------|------|------| | keyword | string | 必填 | 组件名或关键词,如 pit-tableel-form-base。多词空格分隔(OR 匹配) | | maxResults | number | 20 | 最大返回条数 | | contextLines | number | 3 | 每行匹配的上下文行数 |

read_doc

读取组件文档全文。当 search_docs 返回的片段不足以完整回答时使用。

| 参数 | 类型 | 说明 | |-----|------|------| | pathOrUri | string | 文档相对路径(如 pitBusinessUi/table.md)或完整 URI(如 pit-docs:///pitBusinessUi/table.md) |

list_docs

列出可用组件文档目录,便于浏览或不确定组件准确名称时使用。

| 参数 | 类型 | 默认 | 说明 | |-----|------|------|------| | category | string | 可选 | 按库筛选:pitBusinessUipitElementUipitBusinessUtils | | offset | number | 0 | 分页偏移 | | limit | number | 50 | 每页数量 |

get_codegen_spec

获取 pit-simplify-web 后台管理页面代码生成规范。生成 CRUD/管理页面时,必须先调用此工具

| 参数 | 类型 | 默认 | 说明 | |-----|------|------|------| | pageType | string | "all" | standard(标准 CRUD)、left-tree(左树右表)、flow(流程表单)、all(全部) | | includeComponentDocs | boolean | true | 是否包含相关组件的 Props/API 文档摘要 |

Resources

通过 Resource Templates 暴露文档,URI 格式:pit-docs:///pitBusinessUi/{component}.md

  • pitBusinessUipit-docs:///pitBusinessUi/table.md → pit-table
  • pitElementUipit-docs:///pitElementUi/form-base.md → el-form-base
  • pitBusinessUtilspit-docs:///pitBusinessUtils/validate.md → pit-validate

Prompts

在 Cursor 等客户端中可选择以下提示:

  1. PIT Component Docs Lookup:查询 pit-xxx / el-xxx 组件文档。引导 AI 在涉及内部组件时主动调用 search_docs → read_doc。
  2. pit-simplify-web Page Code Generation:生成 pit-simplify-web 后台管理页面。引导 AI 先调用 get_codegen_spec 获取规范,再按规范生成 CRUD/左树右表/流程表单页面。

文档目录

文档已内置在包内(docs/ 目录)。默认使用包自带的文档,无需额外配置。

若需使用外部文档目录,可通过环境变量 DOCS_PATH 自定义:

set DOCS_PATH=E:\my-docs
pit-docs-mcp

安装与运行

从 npm 安装(推荐):

npm install -g pit-docs-mcp
# 或 项目内安装
npm install pit-docs-mcp

从源码安装:

git clone <repo>
cd pit-docs
npm install
npm run build

运行方式:

  • 全局安装后:pit-docs-mcp
  • npx:npx pit-docs-mcp
  • 项目内:node node_modules/pit-docs-mcp/dist/index.js

Cursor 配置

%USERPROFILE%\.cursor\mcp.jsonmcpServers 中添加:

{
  "mcpServers": {
    "pit-docs": {
      "type": "command",
      "command": "npx",
      "args": ["pit-docs-mcp"]
    }
  }
}

若使用全局安装:

{
  "mcpServers": {
    "pit-docs": {
      "type": "command",
      "command": "pit-docs-mcp"
    }
  }
}

若需使用外部文档目录:

{
  "mcpServers": {
    "pit-docs": {
      "type": "command",
      "command": "npx",
      "args": ["pit-docs-mcp"],
      "env": {
        "DOCS_PATH": "D:\\your-custom-docs"
      }
    }
  }
}

使用方式

推荐工作流

  1. 查询组件search_docs → 若片段不足 → read_doc 传入返回的 URI
  2. 浏览组件list_docs 获取目录,再 read_doc 读取感兴趣文档
  3. 生成管理页get_codegen_spec 获取规范 → 收集用户信息(表结构、服务名等)→ 按规范生成代码 → 用 search_docs 补充组件细节

组件名映射

文档文件名与组件名的对应关系:image.md → pit-image,form-base.md → el-form-base,dic.md → pit-dic。

支持的文档类型

  • .md, .mdx - Markdown
  • .vue - Vue 组件
  • .ts, .tsx, .js, .jsx - TypeScript/JavaScript
  • .json - JSON

技术栈

  • TypeScript
  • @modelcontextprotocol/sdk
  • Zod