real-world-mcp
真实世界证据与临床可行性 MCP 服务器
仓库: Krv-Labs/how-to-train-your-dragon
基于纵向索赔数据(Komodo)和公共注册库(ClinicalTrials.gov),对 Graves 病方案(NCT07570316)按每 12 个月预期随机化受试者数对美国医疗机构进行排名,并以交互式 Model Context Protocol (MCP) 服务器形式提供给 AI 智能体使用。
Python 包名为 httyd;MCP 服务器注册名为 real-world-mcp。CLI 入口点:httyd、realworld-mcp 和 how-to-train-your-dragon。
为什么叫这个名字? 基于 Komodo Health 索赔数据构建——将 Komodo 龙驯服并训练成可操作的可行性模型。
1. 架构与包结构
how-to-train-your-dragon/
├── httyd/ # Main Python package
│ ├── models/ # L1–L5 parameters, provenance registry, recruitment math
│ ├── analysis/ # Scoring pipeline, catchment, accrual, site linkage
│ ├── data/ # Dataset catalog, loaders, CTG fetch
│ ├── evaluations/ # Temporal holdout validation
│ ├── auth/ # Kubernetes token auth & scope enforcement
│ ├── engine.py # In-memory FeasibilityEngine singleton
│ ├── cache.py # Precomputed site/geo cache loader
│ └── server.py # MCP server (16 tools, 4 resources, 2 prompts)
├── ui/ # Local observation dashboard (offline HTML)
│ ├── build_dashboard.py
│ └── (writes to output/site_feasibility.html)
├── data/ # Claims & registry assets (not committed — see below)
├── docs/ # Methodology, scoring review, evidence
├── deploy/helm/httyd/ # GKE Helm chart
├── scripts/precompute.py # Build startup cache (Docker + local dev)
├── tests/
├── pyproject.toml
└── README.md数据说明: Komodo 索赔 CSV 已被 gitignore。仅提交 data/nct07570316_sites.json(真实基准数据)。运行引擎前,请将授权数据文件放在本地 data/ 目录中。
方法论与验证证据:docs/README.md。
2. 快速开始
安装
uv sync预计算缓存(推荐)
全量全国评分重建约需 90 秒。预计算一次后即可复用:
uv run python scripts/precompute.py
export REALWORLD_CACHE_DIR=./cache # optional; defaults to ./cache when present运行测试
REALWORLD_CACHE_DIR=./cache uv run pytest部分测试(敏感性重新评分、验证)会触发全量重建,总计约需 2 分钟。
启动 MCP 服务器
# stdio transport (default — Claude Desktop, Cursor)
uv run httyd
# streamable-http (local dev)
AUTH_ENABLED=false REALWORLD_CACHE_DIR=./cache uv run httyd streamable-http
curl http://localhost:8080/health生成本地预览仪表盘
uv run python ui/build_dashboard.py
open output/site_feasibility.html3. MCP 工具面
real-world-mcp 在 6 个领域共暴露 16 个工具:
A. 数据集发现与检查
list_datasets、describe_dataset、get_cohort_summary
B. 模型注册与溯源
list_models、get_provenance
C. 中心搜索与深度分析
search_and_score_sites、get_site_details、explain_site_score
D. 空间覆盖范围与篮子优化
compute_basket_catchment、find_nearby_competitors
E. 入组预测与敏感性分析
simulate_accrual_timeline、update_interim_accrual、compute_sensitivity_rescore、match_trial_facility
F. 验证与局限性
run_model_validation、get_model_limitations
4. MCP 智能体配置
{
"mcpServers": {
"real-world-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/how-to-train-your-dragon",
"run",
"httyd"
],
"env": {
"REALWORLD_CACHE_DIR": "/path/to/how-to-train-your-dragon/cache"
}
}
}
}5. GKE 内部部署
作为内部 ClusterIP MCP 服务部署。子智能体 Pod 使用 Kubernetes ServiceAccount 令牌进行认证,并通过 TokenReview API 验证。
架构
传输方式:
streamable-http,端口 8080,路径/mcp认证: Bearer 令牌 = 投影的 ServiceAccount 令牌(
audience: httyd)授权: ConfigMap 将
system:serviceaccount:<ns>:<name>映射到作用域网络: NetworkPolicy 仅允许来自标记为
httyd-client: "true"的命名空间的入站流量
作用域 | 访问权限 |
| 发现、搜索、解释、溯源工具 |
| 入组模拟、敏感性重新评分、篮子覆盖范围 |
构建与部署
docker build -t httyd:0.1.0 .
helm upgrade --install httyd deploy/helm/httyd \
-n realworld --create-namespace \
--set image.repository=REGION-docker.pkg.dev/PROJECT/REPO/httyd \
--set image.tag=0.1.0部署前,请在 deploy/helm/httyd/scopes.yaml 中注册子智能体 ServiceAccount。
子智能体 Pod 配置
kubectl label namespace app httyd-client=trueserviceAccountName: subagent-feasibility-reader
volumes:
- name: mcp-token
projected:
sources:
- serviceAccountToken:
audience: httyd
expirationSeconds: 3600
path: token
volumeMounts:
- name: mcp-token
mountPath: /var/run/secrets/tokens
readOnly: true
env:
- name: HTTYD_MCP_URL
value: "http://httyd.httyd.svc:8080/mcp"
- name: HTTYD_MCP_TOKEN_FILE
value: "/var/run/secrets/tokens/token"环境变量
变量 | 默认值 | 用途 |
|
| 启用 K8s 令牌认证 |
|
| OAuth 资源标识符 |
|
| SA → 作用域映射 |
|
| 预期令牌受众 |
|
| 预计算的中心/地理 JSON |
|
| HTTP 监听端口 |
|
| HTTP 绑定地址 |
|
| 无状态 MCP 会话(K8s 推荐) |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Physician-reviewed medical opinions and prescriptions for AI agents.
Guardrailed FHIR access for AI agents: PHI redaction, audit trail, step-up auth, tenant isolation
FDA and CMS evidence for AI medical devices: 510(k), postmarket, reimbursement, and compliance.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Krv-Labs/how-to-train-your-dragon'
If you have feedback or need assistance with the MCP directory API, please join our Discord server