内容
<picture>
<img alt="Quasar Store Docs MCP" src="banner.png">
</picture>
# Quasar Store 文档服务器
一个开源的 MCP(模型上下文协议)服务器,允许 AI 编程助手实时查询公共 **Quasar Store** 文档。
与 **Claude Desktop**、**Claude Code**、**Antigravity**(谷歌)、**OpenCode**、**VS Code**(通过 Cline、Continue 或 Copilot MCP)、**Cursor** 以及任何 MCP 兼容的客户端完全兼容。
默认情况下,服务器预配置为与实时 [Quasar Store 文档](https://www.quasar-store.com/docs) 配合使用 - 无需环境变量或额外设置。
---
## 目录
- [工具列表](#工具列表)
- [工作原理](#工作原理)
- [需求](#需求)
- [安装](#安装)
- [逐步设置](#逐步设置)
- [配置](#配置)
- [环境变量(可选)](#环境变量可选)
- [CSS 选择器](#css-选择器)
- [客户端集成](#客户端集成)
- [Claude Desktop](#claude-desktop)
- [Claude Code](#claude-code)
- [Antigravity(谷歌)](#antigravity谷歌)
- [OpenCode](#opencode)
- [VS Code](#vs-code-cline-continue-copilot)
- [Cursor](#cursor)
- [使用示例](#使用示例)
- [项目结构](#项目结构)
- [故障排除](#故障排除)
- [许可证](#许可证)
---
## 工具列表
| 工具 | 类型 | 描述 |
| --- | --- | --- |
| `list_docs` | 发现 | 列出所有文档产品及其文章数量、概览 URL 和章节名称。不需要参数。 |
| `search_docs` | 搜索 | 按关键词搜索文档。返回匹配的文章标题、URL 和片段。 |
| `read_doc` | 读取 | 获取完整的文章内容,以格式化的 Markdown 形式呈现。接受 URL 或相对路径。 |
---
## 工作原理
服务器连接到 `https://www.quasar-store.com/docs` 并通过抓取公共 HTML 页面来提取文档内容。
Quasar Store 文档使用 **Next.js** 构建,并使用 **React Server Components (RSC)**。服务器使用三层策略来处理这个问题:
1. **扫描原始 HTML**,获取 RSC 有效载荷中嵌入的所有 `/docs/...` 链接,构建每个文档文章(40+ 个产品,每个产品有多个子页面)的完整索引。
2. **从 RSC 数据中提取文章内容**,使用尽力而为的文本解析器,提取标题、段落和代码块。如果 RSC 方法失败,则回落到传统的 **cheerio** DOM 提取。
3. **作为最后的手段**,返回文章标题、元描述和相关文档链接列表,以便 AI 仍然可以接收有用的导航。
服务器通过 **stdio**(标准输入/输出)使用 **JSON-RPC** 协议与 AI 客户端通信 - 无需 HTTP 服务器、无需开放端口、无需网络配置。
---
## 需求
- **Node.js** >= 18
- **npm**(随 Node.js 附带)
---
## 安装
您有两个选项:
### 选项 A:通过 npx 安装(推荐 - 无需克隆)
该软件包已发布到 npm,因此您可以直接运行它而无需克隆或安装:
```bash
npx -y quasar-store-docs-mcp
```
然后在您的 MCP 客户端配置中,只需将 `npx` 引用为命令:
```json
{
"command": "npx",
"args": ["-y", "quasar-store-docs-mcp"]
}
```
> **注意:** `-y` 告诉 npx 自动确认安装。如果您想提示确认,请省略它。
### 选项 B:克隆并在本地构建
```bash
git clone https://github.com/iiamdark/quasar-docs-mcp.git
cd quasar-docs-mcp
npm install
npm run build
npm link # 使 `quasar-store-docs-mcp` 在全局范围内可用
```
要验证链接是否有效:
```bash
which quasar-store-docs-mcp # macOS / Linux
where quasar-store-docs-mcp # Windows
```
您应该看到类似 `/usr/local/bin/quasar-store-docs-mcp` 或 `C:\Users\...\npm\quasar-store-docs-mcp` 的路径。
---
## 配置
服务器与 `https://www.quasar-store.com` 作为文档基础配合使用,无需任何环境变量。
### 环境变量(可选)
要将服务器指向不同的文档站点:
```bash
# macOS / Linux
export DOCS_BASE_URL="https://your-docs-site.com"
# Windows(命令提示符)
set DOCS_BASE_URL=https://your-docs-site.com
# Windows(PowerShell)
$env:DOCS_BASE_URL = "https://your-docs-site.com"
```
如果未设置,服务器默认为 `https://www.quasar-store.com`。
### CSS 选择器
如果您将服务器与不同的文档站点一起使用,您可能需要调整 `src/index.ts` 中的 CSS 选择器:
```typescript
const SELECTORS = {
article: "article, .doc-content, .markdown-body, main, .docs-content-page",
title: "h1",
navLinks: "nav a, .sidebar a, .toc a, aside a",
};
```
---
## 客户端集成
您有三个选项在 MCP 客户端配置中引用服务器:
- **选项 A(推荐 - 无需安装):** 使用 `npx -y quasar-store-docs-mcp` - 无需克隆或构建
- **选项 B:** 使用全局命令 `quasar-store-docs-mcp`(运行 `npm link` 后)
- **选项 C:** 直接使用 `build/index.js` 的完整路径
### Claude Desktop
配置文件:`claude_desktop_config.json`
**选项 A - 使用 npx(无需安装):**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "npx",
"args": ["-y", "quasar-store-docs-mcp"]
}
}
}
```
**选项 B - 使用 npm link:**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "quasar-store-docs-mcp"
}
}
}
```
**选项 C - 使用直接路径:**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "node",
"args": ["/full/path/to/quasar-docs-mcp/build/index.js"]
}
}
}
```
### Claude Code
```bash
# 选项 A - 使用 npx:
claude mcp add quasar-store-docs -- npx -y quasar-store-docs-mcp
# 选项 B - 使用 npm link:
claude mcp add quasar-store-docs -- quasar-store-docs-mcp
# 选项 C - 使用直接路径:
claude mcp add quasar-store-docs -- node /full/path/to/quasar-docs-mcp/build/index.js
```
### Antigravity(谷歌)
Antigravity 从 **`~/.gemini/config/mcp_config.json`**(全局)或 **`.agents/mcp_config.json`**(按项目)读取 MCP 服务器配置。
**选项 A - 使用 npx(无需安装):**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "npx",
"args": ["-y", "quasar-store-docs-mcp"]
}
}
}
```
**选项 B - 使用 npm link 或本地构建:**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "quasar-store-docs-mcp"
}
}
}
```
保存后:
1. 重启 Antigravity,或
2. 打开代理侧边栏 → 点击 `...` → `MCP 服务器` → `管理 MCP 服务器` → 服务器应该出现在列表中。
### OpenCode
OpenCode 使用位于 **`~/.config/opencode/opencode.json`** 的配置文件。格式与其他客户端不同:
**选项 A - 使用 npx:**
```jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"quasar-store-docs": {
"type": "local",
"command": ["npx", "-y", "quasar-store-docs-mcp"],
"enabled": true
}
}
}
```
**选项 B - 使用 npm link:**
```jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"quasar-store-docs": {
"type": "local",
"command": ["quasar-store-docs-mcp"],
"enabled": true
}
}
}
```
> **与其他客户端的区别:** OpenCode 使用 `"mcp"`(而不是 `"mcpServers"`)。`command` 字段是一个 **数组**。每个服务器都需要 `"type": "local"` 和 `"enabled": true`。
### VS Code(Cline、Continue、Copilot)
**选项 A - 使用 npx:**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "npx",
"args": ["-y", "quasar-store-docs-mcp"]
}
}
}
```
**选项 B - 使用 npm link 或本地构建:**
```json
{
"mcpServers": {
"quasar-store-docs": {
"command": "quasar-store-docs-mcp"
}
}
}
```
### Cursor
**选项 A - 使用 npx:**
```
Name: quasar-store-docs
Type: command
Command: npx -y quasar-store-docs-mcp
```
**选项 B - 使用 npm link:**
```
Name: quasar-store-docs
Type: command
Command: quasar-store-docs-mcp
```
---
## 工具快速参考
---
### `list_docs` - 浏览可用文档
列出从 Quasar Store 文档索引的所有产品/类别(共 93 个产品)。
**签名:
```
list_docs()
```
不需要参数。
**示例输出(截断):**
```
可用文档类别(共 93 个):
### 高级库存
文章:6 | 概览:https://www.quasar-store.com/docs/advanced-inventory
章节:命令和导出、转换库存项目、一般集成、如何创建任务、安装、项目配置
### 住宅创建者
文章:4 | 概览:https://www.quasar-store.com/docs/housing-creator
章节:命令和导出、安装、库存项目
### 智能手机
文章:5 | 概览:https://www.quasar-store.com/docs/smartphone
章节:命令和导出、如何安装应用、安装
...
```
**何时使用:** 当您不知道存在哪些文档时。从这里开始发现产品,然后搜索或阅读特定文章。
---
### `search_docs` - 按关键词查找文章
按查询词搜索文章标题和 URL。
**签名:
```
search_docs(query: string)
```
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| `query` | string(必填) | 搜索词。匹配文章标题和 URL。区分大小写。 |
**好查询:** `"installation"`、`"database errors"`、`"advanced inventory"`、`"commands"`、`"exports"`、`"common issues"`
**示例输出:**
```
"installation" 的结果:
1. **智能手机 - 安装**
URL:https://www.quasar-store.com/docs/smartphone/installation
文档:智能手机 - 安装
2. **高级库存 - 安装**
URL:https://www.quasar-store.com/docs/advanced-inventory/installation
文档:高级库存 - 安装
3. **警察创建者 - 安装**
URL:https://www.quasar-store.com/docs/police-creator/installation
文档:警察创建者 - 安装
```
**何时使用:** 当您大致知道自己在寻找什么时使用。搜索涵盖文章标题和 URL,因此请使用特定关键词。
**没有结果?** 工具返回前 15 个可用文章作为回落,以便 AI 仍然可以看到存在的内容。
---
### `read_doc` - 读取完整文章内容
获取文档文章并以格式化的 Markdown 返回。
**签名:
```
read_doc(url: string)
```
| 参数 | 类型 | 描述 | 示例 |
| --- | --- | --- | --- |
| `url` | string(必填) | 完整 URL **或** 相对路径。服务器将相对路径解析为基准 URL。 | `"advanced-inventory/installation"` `"https://www.quasar-store.com/docs/smartphone/installation"` `"housing-creator/commands-and-exports"` |
**示例输出:
```markdown
# 安装
> 安装指南 - 请仔细按照每个步骤,确保脚本在您的服务器上正确工作。
---
下载 Cfx.re 资产页面...
## 步骤 1:下载
打开 Cfx.re 授权资产页面...
## 步骤 2:添加到服务器
将文件夹放在您的 `resources` 目录中...
---
来源:https://www.quasar-store.com/docs/advanced-inventory/installation
```
**提取内容:**
- 文章标题和元描述
- 章节标题(转换为 Markdown `#` / `##` / `###`)
- 文本段落
- 代码块
- 列表(项目符号和编号)
- 表格(转换为 Markdown 表格格式)
- 块引用
**何时使用:** 在通过 `list_docs` 或 `search_docs` 找到文章后。传递 URL 或相对路径以获取完整内容。
---
## 使用示例
配置完成后,您的 AI 助手将自动发现 3 个可用工具,并在相关时使用它们。以下是典型的交互模式:
### 模式:发现 → 搜索 → 读取
这是最常见的流程:
| 步骤 | 触发器 | 调用工具 |
| --- | --- | --- |
| 1 | "有哪些文档可用于住房?" | `list_docs()` → 找到 "Housing Creator" |
| 2 | "如何安装它?" | `search_docs("housing creator installation")` → 找到安装文章 |
| 3 | "阅读给我" | `read_doc("housing-creator/installation")` → 返回完整内容 |
### 会话示例
| 您询问... | AI 调用... | 结果 |
| --- | --- | --- |
| "有哪些文档可用?" | `list_docs()` | 完整的产品列表,共 93 个类别 |
| "如何安装高级库存?" | `search_docs("advanced inventory installation")` | 安装指南链接 |
| "常见数据库错误是什么?" | `search_docs("database errors")` | 故障排除文章 |
| "解释住房创建者功能" | `search_docs("housing creator")` + `read_doc(...)` | 完整文章内容 |
| "阅读智能手机命令给我" | `read_doc("smartphone/commands-and-exports")` | 命令以 Markdown 格式 |
| "Admin Menu 有哪些部分?" | `list_docs()` → 在输出中找到 "Admin Menu" | 部分列表 |
---
## 项目结构
```
quasar-docs-mcp/
│
├── src/
│ └── index.ts # MCP 服务器实现
│
├── build/ # 编译的 JavaScript 输出(生成)
│
├── banner.png # README 横幅图像
├── package.json # 依赖项、脚本和元数据
├── tsconfig.json # TypeScript 编译器配置
└── README.md # 此文件
```
### 关键文件解释
| 文件 | 目的 |
|---|---|
| `src/index.ts` | 完整的 MCP 服务器:初始化服务器、注册 `list_docs`、`search_docs` 和 `read_doc` 工具、使用 axios + cheerio 实现 Web 抓取、处理 Next.js 站点的 RSC 有效载荷提取,并包含具有 TTL 的内存缓存 |
| `package.json` | 项目元数据、依赖项(`@modelcontextprotocol/sdk`、`axios`、`cheerio`、`zod`)、构建脚本 |
| `tsconfig.json` | TypeScript 配置,目标为 ES2022,Node16 模块解析 |
| `build/index.js` | 编译输出 - 这是您在 MCP 客户端配置中引用的内容 |
---
## 故障排除
### "命令未找到:quasar-store-docs-mcp"
您尚未运行 `npm link`,或 npm 全局二进制目录不在您的 PATH 中。
- 从项目目录运行 `npm link`
- 或在客户端配置中使用 `build/index.js` 的完整路径
### 服务器启动但工具返回错误
- 检查 `https://www.quasar-store.com` 在您的网络中是否可访问
- 如果您使用自定义文档站点,请尝试设置不同的 `DOCS_BASE_URL`
### "文章未找到(404)"
- 确保 URL 或路径正确
- 相对路径应相对于文档基准 URL(例如 `advanced-inventory/installation`)
- 您始终可以直接使用完整 URL
### 内容提取返回大部分空白
Quasar Store 文档站点使用 Next.js 启用客户端渲染。服务器尝试多种提取策略(RSC → cheerio → 相关链接)。如果所有方法都失败,AI 仍然会收到文章标题、描述和导航到相关文章的链接。
---
## 许可证
```
MIT License
Copyright (c) 2026 iiamdark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
*Built with [Model Context Protocol](https://modelcontextprotocol.io) - 一个连接 AI 助手与工具和数据的开放标准。*
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器