Skip to content

Commit bc3a52a

Browse files
committed
feat(docs-sync): add cache mappings
1 parent 059b7d8 commit bc3a52a

File tree

4 files changed

+318
-6
lines changed

4 files changed

+318
-6
lines changed

packages/yapi-mcp/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ npx -y @leeguoo/yapi-mcp yapi docs-sync
9898

9999
说明:
100100
- 绑定配置保存在 `.yapi/docs-sync.json`(自动维护 `files`:文件名 → API id)
101+
- 绑定模式同步后会写入 `.yapi/docs-sync.links.json`(本地文档 → YApi 文档 URL)
102+
- 绑定模式同步后会写入 `.yapi/docs-sync.projects.json`(项目元数据/环境缓存)
103+
- 绑定模式同步后会写入 `.yapi/docs-sync.deployments.json`(本地文档 → 已部署 URL)
101104
- 兼容旧方式:`--dir` 读取目录内 `.yapi.json``project_id/catid``source_files`
102105
- 管理绑定:`yapi docs-sync bind list|get|add|update|remove`
103106
- 可用 `--dry-run` 只做转换不更新

packages/yapi-mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leeguoo/yapi-mcp",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "YApi Auto MCP Server - Model Context Protocol server for YApi integration, enables AI tools like Cursor to interact with YApi API documentation",
55
"main": "dist/index.js",
66
"bin": {

packages/yapi-mcp/src/skill/install.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const SKILL_MD = [
2525
"## Docs sync",
2626
"- Bind local docs to YApi category with `yapi docs-sync bind add --name <binding> --dir <path> --project-id <id> --catid <id>` (stored in `.yapi/docs-sync.json`).",
2727
"- Sync with `yapi docs-sync --binding <binding>` or run all bindings with `yapi docs-sync`.",
28+
"- Extra mappings (generated after docs-sync run in binding mode):",
29+
" - `.yapi/docs-sync.links.json`: local docs to YApi doc URLs.",
30+
" - `.yapi/docs-sync.projects.json`: cached project metadata/envs.",
31+
" - `.yapi/docs-sync.deployments.json`: local docs to deployed URLs.",
2832
"",
2933
"## Interface creation tips",
3034
"- When adding interfaces, always set `req_body_type` (use `json` if unsure) and provide `res_body` (prefer JSON Schema). Empty values can make `/api/interface/add` fail.",

0 commit comments

Comments
 (0)