开放给 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 |
|---|---|---|
| .. | ||
| cli | Loading commit data... | |
| common | Loading commit data... | |
| config | Loading commit data... | |
| modules | Loading commit data... | |
| openapi | Loading commit data... | |
| prisma | Loading commit data... | |
| queues | Loading commit data... | |
| redis | Loading commit data... | |
| app.module.ts | Loading commit data... | |
| health.controller.ts | Loading commit data... | |
| main.ts | Loading commit data... |