Skip to content

AI 工具调用说明

在 Cursor、Claude Desktop、VS Code 等 AI 工具中开发时,在 你的业务项目 里添加 MCP 配置,由 Agent 学习。

我们提供什么 / 你需要做什么

角色内容
开放平台(我们)在线文档站、llms.txt、MCP 配置示例、官方 Skill
你(以 Cursor 为例)确认配置位置与目录结构 → 添加 .cursor/mcp.json → 在 MCP 面板确认 mos-developer-docs 已连接 → 添加 Skill
你的业务项目                         开放平台
──────────                          ─────────
.cursor/mcp.json          ──MCP──►  https://developer.mosapp.app/llms.txt
.cursor/skills/                       https://developer.mosapp.app/zh/guide/sdk.html
  mos-developer-docs/SKILL.md

在项目中集成 MCP(以 Cursor 为例)

1. 配置位置(Cursor)

添加 MCP 配置前,先确认文件放在哪里:

说明路径
项目级 MCP(推荐)业务项目根目录 .cursor/mcp.json
全局 MCP(所有项目生效)~/.cursor/mcp.json

在 Cursor 中可通过 Settings → MCP 查看状态;配置文件即上述 .cursor/mcp.json

2. 推荐的项目目录结构

在对应路径下按如下结构准备(下一步将在 .cursor/mcp.json 写入 MCP 配置):

text
your-miniapp-project/
├── src/
└── .cursor/
    ├── mcp.json                 # 必做:MCP 配置
    └── skills/
        └── mos-developer-docs/
            └── SKILL.md         # 见下文 Skill 说明

3. 添加 MCP 配置

.cursor/mcp.json(推荐提交 Git)中复制以下内容:

json
{
  "mcpServers": {
    "mos-developer-docs": {
      "command": "npx",
      "args": ["-y", "mcp-fetch-server"],
      "url": "https://developer.mosapp.app/llms.txt"
    }
  }
}

若已有其他 MCP,只追加 mos-developer-docs 节点。需要本机 Node.js(首次启用时 npx 会自动拉取 mcp-fetch-server)。

Windowsnpx 启动失败,将 command / args 改为:

json
{
  "mcpServers": {
    "mos-developer-docs": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "mcp-fetch-server"],
      "url": "https://developer.mosapp.app/llms.txt"
    }
  }
}

也可对照线上文件核对:mos-developer-docs.mcp.json

4. 验证

用 Cursor 打开 你的业务项目,在 MCP 面板确认 mos-developer-docs 已连接,可让 Agent:

请 fetch https://developer.mosapp.app/llms.txt 并简述微应用文档结构。

文档页请使用 fetch_txt,URL 须带 .html 后缀,例如 https://developer.mosapp.app/zh/guide/login.html

官方文档域名:https://developer.mosapp.app

推荐查阅顺序:

  1. https://developer.mosapp.app/llms.txt — 全文索引(MCP fetch)
  2. 文档页 URL 须带 .html — 如 https://developer.mosapp.app/zh/guide/sdk.html

Skill 说明

Skill 提供文档 URL 与查阅顺序;MCP 负责拉取页面内容。

安装 Skill(推荐团队共享)

  1. 复制 mos-developer-docs.skill.md 全文,保存为 .cursor/skills/mos-developer-docs/SKILL.md
  2. 确认路径:.cursor/skills/mos-developer-docs/SKILL.md
  3. 提交 Git 供团队共用

可复制到项目 Rules 的提示词

text
本项目对接 MosApp 开放平台。文档根地址:https://developer.mosapp.app
1. 使用 MCP fetch 拉取 https://developer.mosapp.app/llms.txt 获取索引
2. 再 fetch 具体页面,如 https://developer.mosapp.app/zh/guide/sdk.html
3. 勿臆造 API;文档未记载的能力应向用户确认