MCP Healthcare Reference
Modules · FunctionalModules · TechnicalOverall · FunctionalOverall · Technical
Verified system guide · Overall functional view

A governed path from identity to tools

The system is a runnable home-lab model of an enterprise MCP platform for healthcare. It unifies identity, separates internal and external access, protects clinical reads, gives workloads certificate-backed identity, governs outbound SaaS calls, and joins decisions into one audit trail.

Lab topology: client populations, the Keycloak issuer, two Kong gateway tiers, first-party MCP servers, governed vendor egress, and the audit spine

The lab as implemented: client populations, the Keycloak issuer, two Kong tiers, first-party MCP servers, governed vendor egress, and the audit spine.

What problem it solves

One security vocabulary

Workforce users, customer identities, legacy services, and workloads enter through different front doors. Keycloak turns them into one token format, so gateway and server policy keys off claims in that one vocabulary — never off which IdP the caller came from.

Different catalogs for different risk

Internal and external gateway tiers have separate audiences and route sets. An external patient or partner token cannot simply be replayed against the internal catalog.

Clinical minimum necessary

FHIR tools are curated rather than exposing the full backend. Patient-origin tokens are forced into one patient compartment, while broad operations require role visibility and extra scope.

Governed vendor access

Users connect vendor accounts once. Vendor credentials remain in vault custody (OpenBao), outbound arguments pass through DLP, and only a vendor-specific token reaches the SaaS endpoint.

Every action has an owner

An AI acting through a shared or anonymous credential is unaccountable by construction. Every call here carries one traceable token ID (jti), so any result — including denials — walks back to a person or a named workload in one audit query.

Who uses it

D

Developer / technologist

Signs in once through the brokered workforce identity and works through Claude Code — or the sender-constrained workforce-dpop client, where every call proves possession of a client-held key. Reaches SaaS vendors only through governed egress: DLP-screened, brokered credentials, never a personal access token. (Egress takes ordinary workforce tokens; a key-bound DPoP token is refused there rather than downgraded.)

C

Clinician / business user

Same sign-in, different shape: their assistant discovers only the tools their role permits, sensitive clinical scopes require a step-up, and the FHIR server refuses that scope unless the token carries the MFA mark from login, and every read or booking the assistant makes is attributable to them by name.

P

Patient-facing application

Uses an Auth0-brokered customer identity and external-tier token. The clinical server rewrites searches and validates patient IDs against the token’s patient linkage. Partners and outside SaaS agents would enter through this same curated external tier — target-state, not yet a lab population.

A

Internal agent workload

Receives a rotating SPIFFE certificate, authenticates to Keycloak over mutual TLS without a client secret, and calls scheduling with a certificate-bound token.

S

Identity, platform & security teams

Identity admins own the reviewed realm configuration; platform engineers own the declarative gateway state and lab provisioning; security reviewers walk audit joins by token ID and hold the line with the phased acceptance and red-team gates.

Core functional journey

1
Authenticate

A person or workload proves identity through its appropriate upstream mechanism.

2
Normalize

Keycloak issues the MCP-plane token with identity, tier, server audiences, scopes, and conditional claims.

3
Enter a tier

Kong rejects the wrong tier and applies route-level controls, sender-constraint checks (certificate or DPoP proof), rate limiting, or egress policy.

4
Authorize a tool

The MCP server re-validates the token itself — signature, issuer, its own audience — then applies tool scope, group visibility, and patient rules.

5
Execute and audit

The backend action runs and the final result is recorded with a joinable token identifier.

Five upstream identity sources normalizing through the Keycloak hub into one canonical JWT

Five upstream identities normalize to one canonical JWT.

Five important end-to-end stories

Clinical read

A workforce token enters the internal FHIR route. The server validates it, exposes the caller’s permitted tools, optionally challenges for a broad-read scope, calls HAPI, and audits the actual upstream outcome.

FHIR R4scope step-up

Patient compartment

A customer token enters through the external gateway. If the token contains a patient linkage, a requested patient ID must match and search parameters are overwritten with that patient. Cross-patient reads fail.

external tierhard filter

Stateless scheduling handle

A caller finds a synthetic slot, creates a Postgres-backed hold, and receives a hold ID. Any scheduling replica can later confirm or release it because continuity lives in the handle and database rather than an MCP session.

two replicasexplicit handle

Governed SaaS egress

The internal gateway screens arguments, asks the broker for the current user’s vendor token, and swaps credentials before forwarding. Missing consent starts OAuth; a rotating-token refresh is serialized and persisted with CAS.

DLPOpenBaotoken isolation

One query, the whole story

An auditor takes a single token ID (jti) and one Loki query walks a vendor call end to end: the gateway’s DLP verdict, the broker’s resolve, and the vendor action — denials included. The trail is designed in, not reconstructed after.

audit spinejti join
Governed egress: DLP screening at the gateway, broker resolve from vault custody, vendor token swap

OpenBao custody, single-flight refresh, DLP verdicts, and vendor-token isolation.

Trust boundaries

Internal tier

Workforce, workloads, full first-party catalog, mTLS-capable ingress, certificate-bound token enforcement, a DPoP sender-constrained workforce path, and governed egress routes.

External tier

Curated patient/partner surface, separate tier audience and control plane, lower rate ceiling, and no route to the SaaS egress catalog.

Hub token stops at the validating component

First-party servers use their own backend posture. On vendor routes, the gateway replaces the hub token with the vendor token. The repository contains dormant passthrough code in the FHIR server, but it is not enabled.

Credential custody is separate from identity issuance

The broker stores and refreshes vendor grants but exposes no token minting, JWKS, or authorization-server endpoint. Keycloak remains the MCP-plane issuer.

PHI never reaches the management plane

The gateways are managed from Kong’s SaaS control plane, but that plane sees configuration and aggregate telemetry only. Clinical traffic, tokens, and audit records stay on the local data planes and land in the customer-side audit store — proven by the DPs continuing to serve with the control-plane uplink severed.

How the lab grows phase by phase

0–1
Data + identity

FHIR, observability, hub claims, workforce/customer/legacy paths.

2
Gateway tiers

Internal/external data planes, audience walls, Git-managed state.

3
First-party MCP

Clinical and scheduling tools, scopes, compartment, replicas.

4
Workload identity

Lab CA, SPIRE, mTLS, certificate-bound loop agent.

5–7
Egress + evidence

Broker, OpenBao, DLP, mock vendor, audit joins, red-team probes.

What is real, simulated, and unfinished

Implemented and exercised: identity normalization, tier audiences, server audience validation, tool scope challenges, patient filtering when the claim is present, Postgres hold handles, certificate-binding path, DPoP sender-constraint, DLP, broker consent/refresh/revocation, and joined audit records.
Faithful lab substitutes: fake Ping realm, synthetic FHIR, SPIRE instead of Athenz, mockhub instead of a production vendor, OpenBao dev mode, and local Grafana/Loki/Tempo.
Not ready for a compliance claim: RFC 9728 HTTPS canonical resource identifiers, a formal MCP conformance suite, exact production OAuth/TLS settings, complete booking semantics, an origin allowlist for URL-form (CIMD) client IDs at the external tier (open issues #3 and #23), and sender-constraint for the Claude Code client, which still uses plain bearer tokens. Already in place: the released MCP 2026-07-28 protocol, rejection of tokens missing any contract-mandatory claim, and scheduling Origin checks.
Interpretation rule: passing Phase 0–7 shows the selected lab invariants held in the tested environment. It is not an MCP certification, OAuth 2.1 production certification, HIPAA determination, or proof that every architecture statement is implemented.