fhir-patient-consent-mcp-server
fhir-patient-consent-mcp-server
MCP サーバーです。モデルが患者、その患者のインスリンポンプ、そしてそのデータの閲覧に同意した人について質問できるようにし、すべての情報を FHIR (R4) ストアからリアルタイムに取得します。このサーバーにはデータは一切保存されません。すべての回答はリアルタイムの FHIR REST クエリです。
これは fhir-consent-service のコンパニオンです (FHIR への Patient / Device / Consent を書き込むための Spring Boot API)。ただし、コード上の依存関係はありません。このサーバーは FHIR のワイヤーフォーマットにのみ依存するため、任意の FHIR R4 エンドポイントに対して動作します。
Tools
ツール | 目的 |
| MRN または姓 (family name) で患者を検索する |
| FHIR ID で患者のデモグラフィック情報を取得する |
| 患者のデバイスを一覧表示する (SNOMED CT |
| 患者のデータ共有同意を一覧表示する (パートナー、目的、データカテゴリ、期間) |
| 認可チェック: パートナー X は患者 Y に対する有効な同意を現在持っているか? |
Related MCP server: FHIR MCP Server
Resource
fhir-chart://{patientId} - 患者の統合 JSON「チャート」(デモグラフィック情報 + デバイス + 有効な同意) です。モデルが複数のツール呼び出しにまたがって組み立てるのではなく、ホストアプリケーションがコンテキストに直接添付することを想定しています。これがツールではなくリソースである理由は docs/architecture.md を参照してください。
セットアップ
npm install
npm run buildFHIR サーバーを指定する
export FHIR_BASE_URL=http://localhost:8081/fhir # default shown
export FHIR_AUTH_TOKEN=... # optional bearer tokenクエリ用のデータを取得する最も簡単な方法は、fhir-consent-service の docker compose up -d を実行することです (:8081 でローカルの HAPI FHIR JPA サーバーとが起動します)。その後、その REST API で patient、device、consent を作成し、ここで同じストアをクエリします。
直接実行する (stdio でのテスト用)
npm run devMCP クライアントに登録する
Claude Desktop / Claude Code の場合は、MCP 設定に追加してください:
{
"mcpServers": {
"fhir-patient-consent": {
"command": "node",
"args": ["/absolute/path/to/fhir-patient-consent-mcp-server/dist/index.js"],
"env": {
"FHIR_BASE_URL": "http://localhost:8081/fhir"
}
}
}
}先に npm run build を実行し、dist/index.js が存在するようにしてください。
接続後の質問例
「MRN が MRN-778001 の患者を検索してください。」
「患者 123 のインスリンポンプは何で、そのシリアル番号は何ですか?」
「GlucoVue Remote Monitoring は、患者 123 のデバイスデータを閲覧する同意を与えられていますか?」
「患者 123 の完全なチャートを表示してください。」 (
fhir-chart://リソースを使う例)
テスト
npm testユニットテストはマッパーレイヤー (src/mappers/*.ts) をカバーしており、isConsentActiveForPartner の同意認可ロジックも含みます。具体的には、撤回されたコンセント、未開始/期限切れの期間、そしてオープンエンド (end なし) 期間の扱いです。これらは、特にアンド细微に間違っていることが多いケースだからです。
このリポジトリには、実際の FHIR サーバーに対する統合テストはありません (fhir-consent-service は Testcontainers を使用していますが、それとは異なります)。これは、このサーバーにはデータをシードするための書き込みパスがないためです。テストフィクスチャを設定するためにのみ、そのリポジトリに依存する (またはそのリソース作成ロジックを複製する) 必要があります。もしこのリポジトリにシードスクリプトが追加されれば、そのときに追加してください。
注記: npm レジストリにアクセスできないサンドボックス環境で作成されたため、
npm install/npm run build/npm testは実際にはここでは実行されていません。コードは@modelcontextprotocol/sdk@^1.12を対象としています。インストールした SDK のバージョンでserver.tool(...)/server.resource(...)のシグネチャがregisterTool/registerResourceに移っている場合、修正は機械的です - SDK 自身の README/CHANGELOG を確認してください。
プロジェクト構成
src/
├── index.ts Server entry point, registers all tools/resources
├── fhirClient.ts Thin fetch-based FHIR REST client
├── tools/ One file per MCP tool
├── resources/ One file per MCP resource
├── mappers/ FHIR JSON -> summary objects + consent auth logic
└── util/results.ts Shared tool-result formatting helpersセキュリティに関する注意
このサーバーは PHI のリダクションを行わず、FHIR サーバーが返す内容をそのままパススルーします。実際の患者データに対してデプロイする場合は、FHIR サーバー自体の前段にアクセス制御を置いてください (このサーバーは FHIR_AUTH_TOKEN をベアラートークンとして転送しますが、トンの取得/更新は管理しません)。また、そもそも MCP クライアントに対して何を公開すべきで、何を公開すべきでないかを検討してください。
ライセンス
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 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.1397MIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables seamless integration with FHIR APIs for healthcare applications, allowing users to search, retrieve, create, update, and analyze clinical information through natural language interactions. Supports SMART-on-FHIR authentication and works with various healthcare systems like EPIC and HAPI FHIR servers.
- AlicenseNot gradedqualityCmaintenanceEnables natural-language querying of a mock legacy healthcare database and returns validated FHIR resources (Patient, Observation, Condition).MIT
Related MCP Connectors
Securely access and manage FHIR healthcare data stored in Medplum.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
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/scollard001/fhir-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server