Skip to content

Analyze a Server

The analyze command fetches a CapabilityStatement and produces a structured report.

Terminal window
# From a live server (appends /metadata automatically)
fhir-capability-analyzer analyze https://hapi.fhir.org/baseR4
# From a local JSON file
fhir-capability-analyzer analyze ./capability.json

Human-readable terminal output with sections for resources, operations, profile conformance, security, and warnings.

Terminal window
fhir-capability-analyzer analyze ./examples/us-core-server.json
Server: Example US Core FHIR Server
FHIR Version: 4.0.1
Status: active
Formats: json
Resources (2)
-------------
Patient read, search-type [5 search params]
Observation read, search-type [4 search params]
Profile Conformance
-------------------
US Core (3 profile URL(s))
Security
--------
CORS: enabled
Auth: SMART-on-FHIR

Produces a stable AnalysisReport object — suitable for CI pipelines, AI agents, and downstream processing.

Terminal window
fhir-capability-analyzer analyze ./examples/us-core-server.json --format json

The JSON schema is the AnalysisReport TypeScript type — see Library API.

Produces a Markdown document with tables for resources, profile conformance, and security.

Terminal window
fhir-capability-analyzer analyze ./examples/us-core-server.json --format markdown

The analyzer generates warnings for common CapabilityStatement issues:

WarningWhat it means
No security configuration declaredCORS disabled and no auth services
status is 'draft'May not reflect production capabilities
declares search-type but has no search parametersLikely a misconfiguration
has search parameters but does not declare search-typeLikely a misconfiguration
FHIR version is missing or unrecognizedVersion field missing or non-standard
Server declares no resourcesEmpty REST capabilities

When warnings are found, the command exits with code 1 (text and markdown modes). In JSON mode, warnings are included in the output but the exit code is always 0.

See Exit codes.