Skip to main content
Glama
fhir-mcp-server

fhir-mcp-server

by ysnr-dev

fhir-mcp-server

FHIR R4 サーバー(JP-Core 準拠の fhir-server や HAPI FHIR 等)に接続する MCP(Model Context Protocol)サーバーです。Claude Desktop / Claude Code などの MCP クライアントから、FHIR データを自然言語で検索・参照・(オプトインで)書き込みできます。

  • fhir-server とはリポジトリ分離(接点は HTTP + Bearer トークンのみ)

  • SMART Backend Services(OAuth2 client_credentials + system/* スコープ)のクライアントとして動作

  • FHIR_BASE_URL とクレデンシャルの差し替えで任意の FHIR R4 サーバーに接続可能

クイックスタート

Node.js 20+ が必要です。

npm install
npm run build

# Claude Code に登録(認証なしの fhir-server が localhost:3000 で動いている場合)
claude mcp add fhir -e FHIR_BASE_URL=http://localhost:3000 -- node /path/to/fhir-mcp-server/dist/index.js
  • 認証ありの FHIR サーバーには FHIR_CLIENT_ID / FHIR_CLIENT_SECRET を渡します(両方未設定なら無認証モード)。

  • 書き込みツールは FHIR_MCP_ALLOW_WRITES=true のときだけ登録されます。

  • Node.js を入れずに Docker で動かす方法と Claude Desktop の設定は docs/setup.md を参照してください。

Related MCP server: medplum-mcp

ドキュメント

ドキュメント

内容

docs/setup.md

セットアップ、Docker / docker compose、Claude Code・Desktop への接続、環境変数、SMART Backend Services 認証

docs/web.md

Web版(リモート HTTP MCP)の起動、Auth0 の要点、Cloud Run・Render へのデプロイ、スマホ Claude アプリへの登録

docs/auth0-setup.md

Web版の OAuth を Auth0 に委譲するための詳細手順

docs/tools.md

ツール一覧(参照系・書き込み系)とトークン消費を抑えるコツ

docs/development.md

開発コマンド、integration テスト、ソース構成

docs/DESIGN.md

設計方針とその背景

Available Tools

6 tools
get_capabilitiesGet FHIR server capabilitiesA
Read-only

Fetch the FHIR server's CapabilityStatement (GET /metadata) and return a compact summary: supported resource types, interactions, search parameters, and operations. Call this first to discover what the server supports.

Inputs: no named parameters.

get_historyGet resource historyA
Read-only

Fetch version history. With resourceType and id: history of one resource (GET /{type}/{id}/_history). With only resourceType: history across that type. With neither: system-wide history.

Inputs: id, count, since, resourceType.

patient_everythingFetch a patient's full recordA
Read-only

Fetch all resources in a patient's compartment (GET /Patient/{id}/$everything): conditions, observations, encounters, medications, etc. Use types to limit resource types and since to limit to recently-updated resources — both are recommended to keep responses manageable.

Inputs: patientId (required), count, since, types.

read_fhirRead a FHIR resourceA
Read-only

Read a single resource by type and id (GET /{resourceType}/{id}).

Inputs: id (required), resourceType (required).

search_fhirSearch FHIR resourcesA
Read-only

Search resources of a given type (GET /{resourceType}?...). Search parameters are passed through to the server as-is, so chained parameters, _has, _include, _revinclude, _sort, _total etc. all work. To keep responses small, prefer _elements (comma-separated field list) or _summary=true, and page with _count plus the returned hasNextPage flag (use params like _count/_offset or the server's paging links).

Inputs: resourceType (required), count, params.

validate_fhirValidate a FHIR resourceA
Read-only

Validate a resource against the server's profiles without saving it (POST /{resourceType}/$validate). Use this before create_fhir/update_fhir to catch structural or terminology errors early. The resource JSON must include resourceType.

Inputs: resource (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct FHIR operation: server metadata, searching, reading, patient compartment, history, and validation. No overlaps are apparent.

    Naming Consistency4/5

    Most tool names follow a verb_noun pattern (e.g., get_capabilities, search_fhir), except patient_everything which uses a noun_verb form. The inconsistency is minor and does not hinder understanding.

    Tool Count5/5

    Six tools is appropriate for a FHIR MCP server covering essential interactions: discovery, search, read, patient compartment, history, and validation. The scope is well-balanced.

    Completeness2/5

    The toolset lacks create, update, and delete operations, which are core to resource lifecycle management. The validate_fhir tool even references create_fhir/update_fhir as prerequisites, but they are missing.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables 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.
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides access to Medplum FHIR healthcare data, enabling Claude and other MCP clients to read, search, and query FHIR resources from one or more Medplum environments.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM-based agents and MCP-compatible clients such as Claude Desktop to query and manipulate clinical data through natural-language prompts, supporting full CRUD operations on FHIR resources, OAuth2-secured FHIR API access, AI-powered document ingestion, and semantic search over embedded documents via Pinecone. It also provides LOINC terminology lookup and validation, plus RAG-ready context retrieval for clinical data workflows.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM-based agents and MCP-compatible clients such as Claude Desktop to perform full CRUD operations on Fast Healthcare Interoperability Resources and query clinical data through natural-language prompts. It also provides document ingestion with semantic search, a RAG-ready retrieval pipeline, and LOINC terminology lookup and validation.
      -