rcm-mcp
医疗收入周期管理(RCM)多智能体 MCP 服务器
一个基于 AI 原生的多智能体收入周期管理(RCM)MCP 服务器,实现了资格验证、预先授权以及由 Supabase 和 pgvector 支持的共享推理追踪。
架构概览
┌────────────────────────────┐
│ RCM Multi-Agent System │
│ (Eligibility / PriorAuth)│
└─────────────┬──────────────┘
│ (SSE / HTTP / stdio)
┌─────────────▼──────────────┐
│ FastMCP Server (Port 8000)│
│ trace.* | eligibility.* │
│ priorauth.* │
└─────────────┬──────────────┘
│
┌──────────────────────┴──────────────────────┐
▼ ▼
┌────────────────────────┐ ┌────────────────────────┐
│ Supabase Relational │ │ pgvector / Semantic │
│ (Payers, Coverage, │ │ (Historical Clinical │
│ Rules, Traces) │ │ Precedents & Cases) │
└────────────────────────┘ └────────────────────────┘Related MCP server: mymedi-ai-mcp-server
1. Supabase 数据库设置
步骤 1.1:创建 Supabase 项目
登录 Supabase 并创建一个新项目。
在 项目设置 -> 数据库 下,记下你的 项目 URL 和 API 密钥(
anon或service_role)。
步骤 1.2:启用 pgvector 并应用模式
在 Supabase 仪表板中打开 SQL 编辑器。
复制并粘贴
supabase/schema.sql的内容并运行:启用
vector扩展(CREATE EXTENSION IF NOT EXISTS vector;)。创建表:
payers、appointments、patient_coverage、benefit_accumulators、payer_pa_rules、pa_requests、agent_trace(仅追加)和escalations。创建
match_pa_cases余弦相似度向量搜索函数。
步骤 1.3:加载种子数据
你可以使用以下任一选项将合成数据种子到 Supabase:
选项 A(Python 种子脚本):
一旦你使用 SUPABASE_URL 和 SUPABASE_KEY 配置了 .env:
python seed_data.py选项 B(SQL 编辑器):
在 SQL 编辑器 中,复制并粘贴 supabase/seed.sql 的内容并运行。
这将种子化:
5 个付款方:Aetna Commercial、Blue Cross Blue Shield、UnitedHealthcare、Medicare Part B、Cigna。
5 个预约:计划中的就诊及其目标服务日期(DOS)。
覆盖记录:用于边缘情况测试的有效与终止保单。
福利累积器:特定 CPT 代码的免赔额、共付额、共同保险。
PA 规则与先例:预先授权指南和带有嵌入的历史案例。
2. 环境配置
将 .env.example 复制为 .env:
cp .env.example .env使用你的凭据更新 .env 文件:
# Supabase Configuration
SUPABASE_URL=https://<your-project-ref>.supabase.co
SUPABASE_KEY=<your-supabase-service-role-or-anon-key>
# Server Configuration
MCP_SERVER_HOST=0.0.0.0
MCP_SERVER_PORT=8000
# Optional Embedding Key
OPENAI_API_KEY=3. 安装
安装项目依赖:
pip install -r requirements.txt4. MCP 工具参考
A. 共享追踪工具(trace.*)
所有智能体使用这些工具来维护一个仅追加、可审计的决策日志。
工具名称 | 描述 | 关键输入 | 输出 |
| 将决策记录追加到追踪日志中 |
|
|
| 拉取某个就诊的按时间顺序的决策历史 |
|
|
| 将案例排队以供人工主管审核 |
|
|
B. 资格工具(eligibility.*)
在实际预约服务日期(DOS)验证患者覆盖范围,并估算患者费用。
工具名称 | 描述 | 关键输入 | 输出 |
| 验证有效保单窗口是否覆盖目标服务日期 |
|
|
| 检索累积器余额 |
|
|
| 将检测到的覆盖缺口记录到追踪日志中 |
|
|
C. 预先授权工具(priorauth.*)
自动化程序规则查找、先例搜索和临床理由提交。
工具名称 | 描述 | 关键输入 | 输出 |
| 检查程序代码是否需要预先授权 |
|
|
| 提交临床理由并接收状态 |
|
|
| 轮询已提交授权的状态 |
|
|
| 对历史 PA 案例进行语义向量搜索 |
|
|
5. 运行 MCP 服务器
选项 A:SSE 传输(默认)
通过服务器发送事件(SSE)启动 FastMCP 服务器:
python run_server.pySSE 端点将位于:
http://localhost:8000/sse
选项 B:自定义主机/端口或 Stdio
你可以直接自定义传输参数:
# Run over stdio (e.g. for Claude Desktop / CLI clients)
python src/mcp_server/server.py --transport stdio
# Run over SSE on custom port
python src/mcp_server/server.py --transport sse --port 80806. 测试与验证
使用 pytest 运行测试套件:
pytest tests/预期输出:
tests\test_mcp_tools.py .......... [100%]
============================= 10 passed in 0.07s ==============================7. 连接到智能体客户端
Claude Desktop 配置
将以下内容添加到你的 claude_desktop_config.json:
{
"mcpServers": {
"rcm-server": {
"command": "python",
"args": ["<path-to-repo>/src/mcp_server/server.py", "--transport", "stdio"]
}
}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Agentic-AI operations platform for any business — automate sales, finance, support and back-office w
Deterministic compliance and vertical knowledge bases for autonomous agents. Free 24hr trial.
Supabase-compatible Postgres for agents: projects, branches, SQL, auth, storage, email.
Machine-paid revenue intelligence, recovery decisions, and x402 routing for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLM-based agents to interact with FHIR healthcare data through natural language prompts, providing full CRUD operations on FHIR resources, document processing, and semantic search capabilities.13102MIT
- AlicenseAqualityBmaintenanceHealthcare billing AI for agents — 12 tools for ICD-10/CPT/HCPCS code lookup (80K+ codes), prior auth prediction, medical NER, claims validation, HIPAA compliance auditing, and provider/drug enrichment. Pay-per-call via credits or USDC.32768 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnd-to-end Prior Authorization decision-support system with a multi-agent AI pipeline, MCP Tool Registry, and PostgreSQL backend.1-
- AlicenseAqualityDmaintenanceEnables AI assistants to look up medical billing codes, denial reasons, and payer rules for faster claim resolution.66MIT