{"_id":"@cscec3b-mcp/dop-biz-mcp","_rev":"5-76c4ac0dd0a1c6d0e393eb10a31d8692","name":"@cscec3b-mcp/dop-biz-mcp","dist-tags":{"latest":"0.1.8"},"versions":{"0.1.3":{"name":"@cscec3b-mcp/dop-biz-mcp","version":"0.1.3","license":"UNLICENSED","_id":"@cscec3b-mcp/dop-biz-mcp@0.1.3","maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"bin":{"dop-biz-mcp":"dist/index.cjs"},"dist":{"shasum":"0912172cb9f6f5479a340c22bd1184642d66e45e","tarball":"https://registry.npmjs.org/@cscec3b-mcp/dop-biz-mcp/-/dop-biz-mcp-0.1.3.tgz","fileCount":5,"integrity":"sha512-THB+syNsD4ZeP5wRbL5iNRNISgyqep/WAOyyEsALDSyT7UrAG/ZTZAApSiuN6JM54m7qpDBWQ4l11s9fwYDeaQ==","signatures":[{"sig":"MEQCIBp6VVWVWL2ZuUB6d1btZQVIHf+Q0gCYGQdsGoDm367jAiBsTepH09zub1YCjgH/hbYd2EkrnaONJQeu6Nz/jlNj6g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1478574},"main":"./dist/index.cjs","type":"module","engines":{"node":">=20"},"exports":{".":"./dist/index.cjs"},"gitHead":"5b795384d3012add6971a904ad70cb846c1f52d5","private":false,"scripts":{"dev":"cross-env MCP_ENV=test DEV_MODE=1 node scripts/inspect.mjs","pub":"npm publish","build":"node scripts/build.mjs","gen-json":"node scripts/gen-json.mjs","pub-alpha":"npm version prerelease --preid=alpha --no-git-tag-version && npm run build && npm publish --tag alpha","typecheck":"node scripts/typecheck.mjs","pub-release":"npm version patch --no-git-tag-version && npm run build && npm publish --tag latest","prepublishOnly":"npm run build"},"_npmUser":{"name":"stephenpeng","email":"htmmyqw@hotmail.com"},"_npmVersion":"11.6.2","description":"dop业务mcp","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.12","zod":"^4.4.3","axios":"^1.19.0","esbuild":"^0.21.5","express":"^4.19.2","cross-env":"^7.0.3","typescript":"^5.5.0","@types/node":"^22.0.0","@types/express":"^4.17.21","@cscec/dop-mcp-tool":"^0.1.2","@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dop-biz-mcp_0.1.3_1789092932646_0.7145811457283435","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@cscec3b-mcp/dop-biz-mcp","version":"0.1.4","license":"UNLICENSED","_id":"@cscec3b-mcp/dop-biz-mcp@0.1.4","maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"bin":{"dop-biz-mcp":"dist/index.cjs"},"dist":{"shasum":"ce84a2493e94d36eeb4505cd2d83c58db6f1cc75","tarball":"https://registry.npmjs.org/@cscec3b-mcp/dop-biz-mcp/-/dop-biz-mcp-0.1.4.tgz","fileCount":5,"integrity":"sha512-x/33yXhhm0VDUPTOGA5Arl/sMLdBzmJ3ZsznkhnC8m6CQsS8sKXUqQDHbkEhg6p1gVrehMUWyXIg3CDt5bLHiw==","signatures":[{"sig":"MEYCIQCZk3KcCzoNmW/I6TYZhqnf8ZhWCqQpgvAAvB6C3uqbNgIhAIrX1jidFGULPN+4GBOnEaXApXwb7uAdQVEVQqVxJAZ/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1478655},"main":"./dist/index.cjs","type":"module","engines":{"node":">=20"},"exports":{".":"./dist/index.cjs"},"gitHead":"5b795384d3012add6971a904ad70cb846c1f52d5","private":false,"scripts":{"dev":"cross-env MCP_ENV=test DEV_MODE=1 node scripts/inspect.mjs","pub":"npm publish","build":"node scripts/build.mjs","gen-json":"node scripts/gen-json.mjs","pub-alpha":"npm version prerelease --preid=alpha --no-git-tag-version && npm run build && npm publish --tag alpha","typecheck":"node scripts/typecheck.mjs","pub-release":"npm version patch --no-git-tag-version && npm run build && npm publish --tag latest","prepublishOnly":"npm run build"},"_npmUser":{"name":"stephenpeng","email":"htmmyqw@hotmail.com"},"_npmVersion":"11.6.2","description":"dop业务mcp","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.12","zod":"^4.4.3","axios":"^1.19.0","esbuild":"^0.21.5","express":"^4.19.2","cross-env":"^7.0.3","typescript":"^5.5.0","@types/node":"^22.0.0","@types/express":"^4.17.21","@cscec/dop-mcp-tool":"^0.1.2","@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dop-biz-mcp_0.1.4_1789095432713_0.3624405978369025","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@cscec3b-mcp/dop-biz-mcp","version":"0.1.5","license":"UNLICENSED","_id":"@cscec3b-mcp/dop-biz-mcp@0.1.5","maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"bin":{"dop-biz-mcp":"dist/index.cjs"},"dist":{"shasum":"9a52b1d00d5b8e5b12709d5ea71277beea2fddc8","tarball":"https://registry.npmjs.org/@cscec3b-mcp/dop-biz-mcp/-/dop-biz-mcp-0.1.5.tgz","fileCount":5,"integrity":"sha512-5FbaoXrxpZotZkquhESsCWlQVTXViftlpCKdDCW75qebK+6LYlZBIfBauNhjVFLEwejOfMIcQxnymqma2DXzSw==","signatures":[{"sig":"MEQCIGLm2NPHV5Fctjm37++41INBZk0C3cBOfXJx0lXAdzH+AiAy+oY3xHR8mTiZrnQp18t7IktgFmKAe6hMb1Pk/66Olw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1478655},"main":"./dist/index.cjs","type":"module","engines":{"node":">=20"},"exports":{".":"./dist/index.cjs"},"gitHead":"5b795384d3012add6971a904ad70cb846c1f52d5","private":false,"scripts":{"dev":"cross-env MCP_ENV=test DEV_MODE=1 node scripts/inspect.mjs","pub":"npm publish","build":"node scripts/build.mjs","gen-json":"node scripts/gen-json.mjs","pub-alpha":"npm version prerelease --preid=alpha --no-git-tag-version && npm run build && npm publish --tag alpha","typecheck":"node scripts/typecheck.mjs","pub-release":"npm version patch --no-git-tag-version && npm run build && npm publish --tag latest","prepublishOnly":"npm run build"},"_npmUser":{"name":"stephenpeng","email":"htmmyqw@hotmail.com"},"_npmVersion":"11.6.2","description":"dop业务mcp","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.12","zod":"^4.4.3","axios":"^1.19.0","esbuild":"^0.21.5","express":"^4.19.2","cross-env":"^7.0.3","typescript":"^5.5.0","@types/node":"^22.0.0","@types/express":"^4.17.21","@cscec/dop-mcp-tool":"^0.1.2","@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dop-biz-mcp_0.1.5_1789095865610_0.14253008088115404","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@cscec3b-mcp/dop-biz-mcp","version":"0.1.7","license":"UNLICENSED","_id":"@cscec3b-mcp/dop-biz-mcp@0.1.7","maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"bin":{"dop-biz-mcp":"dist/index.cjs"},"dist":{"shasum":"ae74ee5d78a1efb282ce8979411564ac169fd6c9","tarball":"https://registry.npmjs.org/@cscec3b-mcp/dop-biz-mcp/-/dop-biz-mcp-0.1.7.tgz","fileCount":5,"integrity":"sha512-Nf0jhZekNbAjrHMMqIisoVBgVTVcJakqtExzQYZrF7eqOFjr6XQVIX7NnqSu+BE6pp5POLHm8743aDjbieRRUg==","signatures":[{"sig":"MEQCIAJmmdUNCTWCtDWkPK59eINxeLb61jBoZQp0Am66K28DAiBRN1QbLOzCZF6rL3+ejmAKZ6GkQ7ybvgUBSsk+n4q7kA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1510211},"main":"./dist/index.cjs","type":"module","engines":{"node":">=20"},"exports":{".":"./dist/index.cjs"},"gitHead":"669839261c3b4a6875ef111984b0f9075adecc75","private":false,"scripts":{"dev":"cross-env MCP_ENV=test DEV_MODE=1 node scripts/inspect.mjs","pub":"npm publish","build":"node scripts/build.mjs","gen-json":"node scripts/gen-json.mjs","pub-alpha":"npm version prerelease --preid=alpha --no-git-tag-version && npm run build && npm publish --tag alpha","typecheck":"node scripts/typecheck.mjs","pub-release":"npm version patch --no-git-tag-version && npm run build && npm publish --tag latest","prepublishOnly":"npm run build"},"_npmUser":{"name":"stephenpeng","email":"htmmyqw@hotmail.com"},"_npmVersion":"11.6.2","description":"dop业务mcp","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.12","zod":"^4.4.3","axios":"^1.19.0","esbuild":"^0.21.5","express":"^4.19.2","cross-env":"^7.0.3","typescript":"^5.5.0","@types/node":"^22.0.0","@types/express":"^4.17.21","@cscec/dop-mcp-tool":"^0.1.2","@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dop-biz-mcp_0.1.7_1789107287814_0.5528185608516885","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"_id":"@cscec3b-mcp/dop-biz-mcp@0.1.8","bin":{"dop-biz-mcp":"dist/index.cjs"},"dist":{"shasum":"f5f53ea2eb227929b635aaa7b1bcd6252c811d86","tarball":"https://registry.npmjs.org/@cscec3b-mcp/dop-biz-mcp/-/dop-biz-mcp-0.1.8.tgz","fileCount":5,"integrity":"sha512-geLrwRu2amu4jEN915I2Xz2IQqXdMnWC90ryOAod0AEkJfcDXQry0U2IWs9H6WGPthgfvKPKDbFWDLB8lU6pyQ==","signatures":[{"sig":"MEQCIFWwEjDEP9nciUDJXfJiVj/zVSNS5NfyC/JY2TOaVLWNAiAzz9t+sfz/3HQakSHXIP4yxXvsSNuJT98FsgFy8VNHBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDBzHe/OisMYfcIaJWUecFoO4AT4D9qedeUomIybQbYuAiBEpQ5rikhgnKvnM02Z5vidLob/Ci64UistHw+lVqYSJA=="}],"unpackedSize":1510203},"main":"./dist/index.cjs","name":"@cscec3b-mcp/dop-biz-mcp","type":"module","engines":{"node":">=20"},"exports":{".":"./dist/index.cjs"},"gitHead":"a84dac863516c17a237a95e6f207e4829ca59ec4","license":"UNLICENSED","private":false,"scripts":{"dev":"cross-env MCP_ENV=test DEV_MODE=1 node scripts/inspect.mjs","pub":"npm publish","build":"node scripts/build.mjs","gen-json":"node scripts/gen-json.mjs","pub-alpha":"npm version prerelease --preid=alpha --no-git-tag-version && npm run build && npm publish --tag alpha","typecheck":"node scripts/typecheck.mjs","pub-release":"npm version patch --no-git-tag-version && npm run build && npm publish --tag latest","prepublishOnly":"npm run build"},"version":"0.1.8","_npmUser":{"name":"stephenpeng","email":"htmmyqw@hotmail.com"},"_npmVersion":"11.6.2","description":"dop业务mcp","directories":{},"maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.12","zod":"^4.4.3","axios":"^1.19.0","esbuild":"^0.21.5","express":"^4.19.2","cross-env":"^7.0.3","typescript":"^5.5.0","@types/node":"^22.0.0","@types/express":"^4.17.21","@cscec/dop-mcp-tool":"^0.1.2","@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dop-biz-mcp_0.1.8_1790556628788_0.1735903183688834"}}},"time":{"created":"2026-09-11T02:15:32.425Z","modified":"2026-09-28T00:50:29.068Z","0.1.3":"2026-09-11T02:15:32.785Z","0.1.4":"2026-09-11T02:57:12.876Z","0.1.5":"2026-09-11T03:04:25.753Z","0.1.7":"2026-09-11T06:14:47.933Z","0.1.8":"2026-09-28T00:50:28.890Z"},"license":"UNLICENSED","description":"dop业务mcp","maintainers":[{"name":"cscec3b_npm","email":"cscec3b_npm@163.com"},{"name":"zhangshichun","email":"zhangshichun_looper@aliyun.com"},{"name":"waitingsun910","email":"408437662@qq.com"},{"name":"stephenpeng","email":"htmmyqw@hotmail.com"}],"readme":"# @cscec3b-mcp/dop-biz-mcp\r\n\r\ndop业务mcp\r\n\r\n> 由 `@cscec/create-dop-mcp` 脚手架生成,基于 DOP MCP 模板(扫码登录与 token 管理由 `@cscec/dop-mcp-tool` 提供)。\r\n\r\n\r\n## 目录结构\r\n\r\n```\r\ndop-biz-mcp/\r\n├── package.json          # bin 指向 dist/index.cjs;发布自包含(dependencies 为空,esbuild 全内联)\r\n├── scripts/\r\n│   ├── lib.mjs           # 构建共用路径:buildTool()(tsc 编译共享库) + buildMcp()(esbuild 打包 + 复制 help-doc.md)\r\n│   ├── build.mjs         # yarn build:产出自包含 dist/index.cjs\r\n│   ├── inspect.mjs       # yarn dev:MCP Inspector 调试 + esbuild watch(改源码自动 rebuild,Inspector 里重连即生效)\r\n│   ├── typecheck.mjs     # yarn typecheck:先编译共享库(.d.ts)再 tsc --noEmit\r\n│   └── gen-json.mjs      # yarn gen-json [--env test|pre|prod]:生成 .mcp.npm.json(MCP 客户端配置,npx 拉发布包)\r\n└── src/\r\n    ├── index.ts          # 入口:第一行 import './base/env.js'(解析 --env/--dev-mode,必须最先);createServer() 里每行注册一个工具\r\n    ├── help-doc.md       # help 工具返回的文档:公共鉴权 + 各场景 SOP,新增业务场景时追加子章节\r\n    ├── base/             # 基建层(被业务依赖、自身不依赖业务 service)\r\n    │   ├── env.ts        # --env test|pre|prod + --dev-mode(日志)参数解析(Inspector 不继承父进程 env,用参数显式传;--dev 是 Inspector 保留字)\r\n    │   ├── config.ts     # currentEnv() + 业务网关配置 ENV_BIZ_CONFIG(按环境切 apiBase/appId/tenant)\r\n    │   ├── logger.ts     # JSON 追加日志到 cwd/mcp-dop-biz.log,仅 DEV_MODE=1 落盘(与 MCP_ENV 解耦)\r\n    │   ├── http.ts       # 共用 axios 实例;拦截器统一注入 Authorization: bearer <iamToken>(实时读盘、临期自动续期)\r\n    │   └── request.ts    # dopGet/dopPost/dopGetRaw:解 {code,success,message,data} 信封\r\n    ├── service/          # 按接口域封装 REST 调用(纯函数,不碰 MCP)\r\n    │   └── common.ts     # getUserInfo(biz /api/auth/getUserInfo)\r\n    └── tools/            # 每个工具一个文件,导出 registerXxx(server)\r\n        ├── help.ts                 # 返回 help-doc.md(+共享库文档)\r\n        ├── portalQrLoginStart.ts   # 启动扫码登录(非阻塞,返回 loginUrl)\r\n        ├── portalQrLoginWait.ts    # 阻塞等待扫码完成(登录态加密落盘)\r\n        └── getUserInfo.ts          # 查当前用户与组织(未登录返回 loggedIn:false + 扫码指引)\r\n```\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 仓库根目录装依赖(yarn 1 workspaces,packages/* 自动纳入)\r\nyarn install\r\n\r\n# 调试:起 MCP Inspector(浏览器 UI)+ esbuild watch;改源码后 Inspector 里手动重连即可\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp dev\r\n\r\n# 构建/类型检查\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp build\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp typecheck\r\n```\r\n\r\n环境由 `MCP_ENV` 决定(`test|pre|prod`,默认 prod),只切换后端域名;`yarn dev` 默认 test 并带 `DEV_MODE=1`。日志开关独立:`DEV_MODE=1` 才落盘(见 base/logger.ts,空/0 静默)。裸 `node dist/index.cjs` 不带参数回落 prod 且不写日志。\r\n\r\n## 如何新增一个工具\r\n\r\n1. **service 层**:`src/service/<域>.ts` 封装 REST 调用——用 `dopGet`/`dopPost`(解 `{code,success,message,data}` 信封)或 `dopGetRaw`(不包信封的接口)。**不要显式传 token**,http.ts 拦截器统一注入。\r\n2. **tool 层**:`src/tools/<工具名>.ts`,导出 `registerXxx(server: McpServer)`,用 zod 声明 `inputSchema`/`outputSchema`。**声明了 `outputSchema` 就必须返回 `structuredContent`**(SDK 强制)。参考 `src/tools/getUserInfo.ts` 的写法(含「未登录不算工具错误」的降级模式)。\r\n3. **注册**:`src/index.ts` 的 `createServer()` 里加一行 `registerXxx(server);`。\r\n4. **文档**:`src/help-doc.md` 追加场景章节(工具用途/入参约束/分页约定/展示要求)——这是给使用 MCP 的 AI 看的操作指引,工具描述里写「使用前先调用本 MCP 的 help_tool 查看文档」引导 AI 先读它。\r\n\r\n改完跑 `yarn typecheck`;`yarn dev` 的 watch 会自动 rebuild(含 help-doc.md 复制),Inspector 里重连即生效。\r\n\r\n## 关键约定 / 坑\r\n\r\n- **esbuild 必须打成 CJS**:axios 有动态 require,ESM bundle 会炸;bundle 里 `import.meta.url` 不可用——运行时定位文件用 `process.cwd()`/`__dirname`(见 `logger.ts`、`tools/help.ts`)。\r\n- **MCP Inspector 不继承父进程 env**:server 支持 `--env <env>` 与 `--dev-mode`(日志开关,等价 DEV_MODE=1)参数(`src/base/env.ts` 最先加载解析),inspect.mjs 把环境与日志开关写进启动命令。**server 自定义参数避开 Inspector 保留字**(`--dev`/`-e`/`--config` 等会被 Inspector 吃掉不透传)。\r\n- **19 位 snowflake ID 一律字符串透传**(zod 用 `z.string()`):超 JS Number 安全整数,转数字精度丢失,后端查不到。\r\n- **日志不含 token**:请求日志只记 method/url/params/body,不记 headers;日志文件仅 `DEV_MODE=1` 时落盘(与 `MCP_ENV` 解耦,prod 也可显式开)。\r\n- **登录态**:扫码一次全场景通用,token 临期由共享库自动续期;任何工具返回 `HTTP 401/402` 或 `token 无效` → 重新扫码登录 → 重试。\r\n- **token 分工**:业务工具只用 iamToken(拦截器注入);门户 token 只在共享库登录域内部使用,不出库。\r\n- **发布自包含**:依赖全在 devDependencies(esbuild 内联),`dependencies` 为空;`files: [\"dist\"]`,`help-doc.md` 靠 build 脚本复制进 dist——**改文档要重新 `yarn build`**。\r\n- **yarn 1 的 `.yarnrc` 必须放各 package 目录**(不向上查找),registry 指 `https://registry.npmmirror.com`。\r\n\r\n## 发布\r\n\r\n```bash\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp pub          # 发 alpha/当前 tag\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp pub-alpha    # 版本号 prerelease(alpha) + 发布\r\nyarn workspace @cscec3b-mcp/dop-biz-mcp pub-release  # 版本号 patch + 发布 latest\r\n```\r\n\r\n发布前改 `package.json` 的 `name`/`bin` 为实际包名;registry 走 `publishConfig.registry`。","readmeFilename":"README.md"}