Token导航 LogoToken导航TokenDH.com
Package7 MCP logo
文档知识stdio官方级别未说明来源级核验

Package7 MCP

MCP Server

@smithery/cli@latest

通用模型上下文协议服务器,用于访问和搜索库文档,支持多库文档检索、高级搜索算法和智能文档处理。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
文档检索开发工具TypeScriptClaude搜索引擎Claude DesktopClaudeCursorWindsurfClineVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Vooster-AI

提供方

Vooster-AI

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli@latest install package7-mcp --client <CLIENT_NAME>

详细介绍

文档索引MCP

![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org/) ![TypeScript](https://www.typescriptlang.org/) ](https://pnpm.io/)

用于访问和搜索库文档的通用MCP(模型上下文协议)服务器。使LLM代理能够使用高级文本排名算法检索和分析任何配置库的文档。

特性

  • 多库支持:同时访问多个已配置库的文档
  • 高级搜索:使用BM25排名算法进行基于关键字的文档检索,以获得精确的结果
  • 智能文档处理:分析和处理带有令牌估计的降价文档
  • 语义分块:将文档拆分为语义上有意义的块,以更好地进行上下文管理
  • 许可证管理:LLM上下文窗口的高效令牌计数和管理
  • 元数据抽取:自动提取文档结构和元数据(标题、代码块、表格)
  • 基于类别的权重:基于文档类别和部分的智能排名
  • 灵活的配置:支持多种搜索模式和可定制的关键字权重
  • 使用TypeScript构建:全类型安全和全面的测试覆盖

安装

NPM

npm install -g package7-mcp

史密瑟里

通过以下方式自动为任何客户端安装文档索引MCP服务器 史密瑟里:

npx -y @smithery/cli@latest install package7-mcp --client 

可用客户端: cursor, claude, vscode, windsurf, cline, zed等等。

光标示例:

npx -y @smithery/cli@latest install package7-mcp --client cursor

来源

# Install dependencies
pnpm install

# Build the project
pnpm build

# Run the server
pnpm start

MCP客户端集成

文档索引MCP可以与支持模型上下文协议(MCP)的各种AI编码助手和IDE集成。

需求

  • Node.js>=v18.0.0
  • pnpm>=v8.0.0
  • MCP兼容客户端(Cursor、Claude Code、VS Code、Windsurf等)

Install in Cursor

首选 Settings -> Cursor Settings -> MCP -> Add new global MCP server

将以下配置添加到您的 ~/.cursor/mcp.json 文件:

{
  "mcpServers": {
    "docs-index": {
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Claude Code

运行此命令:

claude mcp add docs-index -- npx -y package7-mcp

Install in VS Code

将此添加到您的VS Code MCP配置文件中。看 VS代码MCP文档 了解更多信息。

"mcp": {
  "servers": {
    "docs-index": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Windsurf

将此添加到您的Windsurf MCP配置文件中:

{
  "mcpServers": {
    "docs-index": {
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Cline

  1. 打开 克莱恩
  2. 点击汉堡菜单图标(☰)进入 MCP服务器 章节
  3. 选择 远程服务器 标签
  4. 点击 编辑配置 按钮
  5. 将文档索引添加到 mcpServers:
{
  "mcpServers": {
    "docs-index": {
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Claude Desktop

打开Claude Desktop开发人员设置并编辑您的 claude_desktop_config.json 文件:

{
  "mcpServers": {
    "docs-index": {
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Zed

将此添加到您的Zed settings.json:

{
  "context_servers": {
    "docs-index": {
      "source": "custom",
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Install in Roo Code

将此添加到Roo Code MCP配置文件中:

{
  "mcpServers": {
    "docs-index": {
      "command": "npx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

Using with Bun

{
  "mcpServers": {
    "docs-index": {
      "command": "bunx",
      "args": ["-y", "package7-mcp"]
    }
  }
}

用法

MCP服务器提供以下工具:

获取库列表

检索可用库及其元数据的列表。

参数:

退货:

{
  "libraries": [
    {
      "id": "react",
      "name": "React",
      "version": "18.0.0",
      "description": "A JavaScript library for building user interfaces"
    }
  ]
}

获取文档

使用BM25排名算法通过基于关键字的检索搜索图书馆文档。

参数:

{
  "libraryId": "react",
  "query": "hooks state management",
  "limit": 10
}

退货: 包含分数和元数据的文档数组:

{
  "documents": [
    {
      "id": "doc-123",
      "title": "Using the State Hook",
      "content": "...",
      "score": 0.95,
      "metadata": {
        "section": "Hooks",
        "category": "Advanced"
      }
    }
  ]
}

按id文档

按ID获取完整文档内容。

参数:

{
  "documentId": "doc-123"
}

退货:

{
  "id": "doc-123",
  "title": "Using the State Hook",
  "content": "Complete document content...",
  "metadata": {
    "tokens": 1250,
    "section": "Hooks"
  }
}

用法示例

示例1:搜索文档

在光标/克劳德代码中:

Search for React documentation about hooks and find examples of useState usage

示例2:获取特定的库信息

在任何MCP客户端中:

What libraries are available and show me the latest React documentation

示例3:分析代码模式

在光标/克劳德代码中:

I need to understand how to manage state in React.
Search the React documentation for state management patterns.

建筑

该项目采用模块化架构:

  • 常数/:配置常数和基本提示
  • 文件/:文档处理逻辑

- 分流器/:Markdown解析和文档分块实用程序 - 解析器/:针对不同节点类型的专用解析器

  • 存储库/:数据访问层和文档存储库
  • 模式/:用于运行时类型验证的Zod模式
  • 工具/:MCP工具实现
  • server.ts:主服务器入口点

核心组件

  • MarkdownSplitter:具有语义感知的智能标记文档拆分
  • BM25计算器:搜索相关性的高级排名算法
  • 令牌估计器:用于上下文管理的高效令牌计数
  • 文档加载器:灵活的文档加载和缓存
  • Chunk转换器:不同文档格式之间的转换

发展

设置

# Install dependencies
pnpm install

# Run in development mode (watch mode)
pnpm dev

# Type check
pnpm typecheck

建筑

pnpm build

代码质量

# Lint code
pnpm lint

# Fix linting issues
pnpm lint:fix

# Format code with Prettier
pnpm format

测试

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Generate coverage report
pnpm test:coverage

该项目涵盖了以下方面的全面测试:

  • 文档处理和解析
  • BM25排名算法
  • 代币估算
  • 搜索功能
  • 存储库操作

项目结构

src/
├── constants/              # Configuration constants and prompts
│   ├── base-prompt.ts      # Base system prompts
│   ├── category.ts         # Category definitions
│   ├── keyword-weight-config.ts # Search weight configuration
│   └── search-mode.ts      # Search mode definitions
├── document/               # Document processing logic
│   ├── splitter/           # Markdown splitting utilities
│   │   ├── markdown-splitter.ts  # Main splitter
│   │   ├── parser/         # Node-type specific parsers
│   │   └── extractMetadata.ts    # Metadata extraction
│   ├── token-estimator.ts  # Token counting
│   ├── document-loader.ts  # Document loading
│   ├── chunk-converter.ts  # Format conversion
│   └── __test__/           # Document tests
├── repository/             # Data access layer
│   ├── docs.repository.ts  # Document repository
│   └── createDocsRepository.ts # Factory function
├── schema/                 # Zod schemas
│   └── get-document-schema.ts   # Request schemas
├── tool/                   # MCP tool implementations
│   └── tools.ts            # Tool definitions
└── server.ts               # Main server entry point

配置

搜索模式

服务器支持通过常量配置的多种搜索模式:

  • BM25:高级相关性排名(默认)
  • 关键词:简单的关键字匹配
  • 语义:上下文感知搜索

类别权重

文档可以按类别加权以获得更好的排名:

const categoryWeights = {
  'Getting Started': 1.2,
  'API': 1.0,
  'Examples': 0.9
};

脚本

  • pnpm build -使用TypeScript构建项目
  • pnpm dev -手表开发模式
  • pnpm start -启动MCP服务器
  • pnpm test -运行所有测试
  • pnpm test:watch -在监视模式下运行测试
  • pnpm test:coverage -生成覆盖率报告
  • pnpm lint -使用ESLint的Lint代码
  • pnpm lint:fix -修复掉毛问题
  • pnpm format -使用Prettier格式化代码
  • pnpm typecheck -无建筑类型检查

Docker支持

构建Docker镜像

docker build -t package7-mcp .

使用Docker运行

docker run -d -p 3000:3000 \
  --name docs-index \
  package7-mcp

Docker编写示例

创建一个 docker-compose.yml:

version: '3.8'

services:
  docs-index:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/mcp', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 5s

使用Docker Compose运行:

docker-compose up -d

贡献

欢迎投稿!请随时提交拉取请求。

许可证

麻省理工学院

作者

choesumin

目录标签

目录标签

文档检索开发工具TypeScriptClaude搜索引擎本地部署文本分析知识管理

支持客户端

Claude DesktopClaudeCursorWindsurfClineVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@smithery/cli@latest

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP