开放给 agent 的 MCP 只读服务,第一步基座:
- PatientService.search(scope, query, limit):按 姓名/手机/externalId 模糊检索,强制 tenant scope,
返回极简候选卡片(手机号掩码,真号走 revealPhone)。= find_patient 工具背后。
- 装 @modelcontextprotocol/sdk@1.29.0。
- 集成侦察(避免踩坑):经典 moduleResolution=Node 下静态 import 走
@modelcontextprotocol/sdk/dist/cjs/server/{mcp,streamableHttp}.js(CJS + 带 .d.ts);
registerTool(name,{description,inputSchema:ZodRawShape},cb)+ StreamableHTTPServerTransport
无状态(sessionIdGenerator:undefined, enableJsonResponse:true)+ handleRequest(req,res,body)。
- Bearer 鉴权复用 JwtService(jwt.secret),payload 含 hostId/tenantId/permissions → 派生 scope。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .claude | Loading commit data... | |
| apps | Loading commit data... | |
| clickhouse/config.d | Loading commit data... | |
| deploy | Loading commit data... | |
| docs | Loading commit data... | |
| packages | Loading commit data... | |
| scripts | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .npmrc | Loading commit data... | |
| .prettierrc | Loading commit data... | |
| README.md | Loading commit data... | |
| docker-compose.prod.yml | Loading commit data... | |
| docker-compose.yml | Loading commit data... | |
| eslint.config.mjs | Loading commit data... | |
| liu.cjs | Loading commit data... | |
| package.json | Loading commit data... | |
| pnpm-lock.yaml | Loading commit data... | |
| pnpm-workspace.yaml | Loading commit data... | |
| tsconfig.base.json | Loading commit data... | |
| turbo.json | Loading commit data... |