fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
claude mcp add --transport stdio wso2-fhir-mcp-server uvx fhir-mcp-server \ --env FHIR_MCP_HOST="Hostname for MCP server (default: localhost)" \ --env FHIR_MCP_PORT="Port for MCP server (default: 8000)" \ --env FHIR_SERVER_SCOPES="OAuth scopes for the FHIR server (required if authorization enabled)" \ --env FHIR_SERVER_BASE_URL="Base URL of the target FHIR server (required; enable/disable auth via other vars)" \ --env FHIR_SERVER_CLIENT_ID="OAuth client ID for SMART on FHIR (required if authorization enabled)" \ --env FHIR_SERVER_CLIENT_SECRET="OAuth client secret for SMART on FHIR (required if authorization enabled)" \ --env FHIR_SERVER_DISABLE_AUTHORIZATION="Set to True to disable authorization (optional; default is false)"
How to use
This MCP server exposes a FHIR-focused Model Context Protocol endpoint that bridges interactions between a FHIR API server and MCP clients. It supports standard MCP transport modes and SMART-on-FHIR based authentication to securely access FHIR resources. With the server running, you can query, search, and fetch FHIR resources through MCP-compatible tooling, and leverage integration points with popular MCP clients such as VS Code, Claude Desktop, and MCP Inspector. The server configuration is designed to be used with the uvx runner for Python installations, and it relies on environment variables to control the FHIR backend and OAuth behavior. To start using it, install the Python package (fhir-mcp-server) via uvx and set the required environment variables, then run the MCP server to listen on the configured host/port. Tools integrated with this server enable you to connect, browse, and test FHIR operations within your preferred MCP ecosystem.
How to install
Prerequisites: Python 3.8+, uv (for dependency management) or uvx via PyPI, and an accessible FHIR API server. The MCP server is distributed as a Python package (fhir-mcp-server).
Installing using PyPI Package
- Configure Environment Variables (example):
FHIR_SERVER_BASE_URL="" FHIR_SERVER_CLIENT_ID="" FHIR_SERVER_CLIENT_SECRET="" FHIR_SERVER_SCOPES=""
FHIR_MCP_HOST="localhost" FHIR_MCP_PORT="8000"
- Install the package and run the server:
uvx fhir-mcp-server
Installing from Source
- Clone the repository:
git clone <repository_url> cd <repository_directory>
- Create and activate a virtual environment, then install dependencies:
uv venv source .venv/bin/activate uv pip sync requirements.txt
Or with pip:
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
- Configure Environment Variables (copy example and customize as needed):
cp .env.example .env
- Run the server:
uv run fhir-mcp-server
Installing using Docker
- Build or pull the image:
docker build -t fhir-mcp-server .
or
docker pull wso2/fhir-mcp-server:latest
- Configure environment variables (via .env or -e flags) and run:
docker run --env-file .env -p 8000:8000 fhir-mcp-server
- Optional: use Docker Compose with a HAPI FHIR server setup as described in the repository documentation.
Additional notes
Notes and tips: - By default the MCP server runs on http://localhost:8000; adjust FHIR_MCP_HOST and FHIR_MCP_PORT to suit your environment. - If you rely on OAuth, ensure FHIR_SERVER_BASE_URL, FHIR_SERVER_CLIENT_ID, FHIR_SERVER_CLIENT_SECRET, and FHIR_SERVER_SCOPES are set; to disable authorization, set FHIR_SERVER_DISABLE_AUTHORIZATION=True. - When running via Docker, authorization should be disabled for local testing as described in the Docker section. - The server supports MCP transport over stdio, SSE, or HTTP streaming depending on the client and configuration. - Review the .env.example for a full list of environment variables and their intended usage.
Related MCP Servers
web-eval-agent
An MCP server that autonomously evaluates web applications.
web-agent-protocol
🌐Web Agent Protocol (WAP) - Record and replay user interactions in the browser with MCP support
mcp-tool-kit
Agentic abstraction layer for building high precision vertical AI agents written in python for Model Context Protocol.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.
fhir
FHIR MCP Server for handling medical data standard.
python
🔐 Plug-and-play auth for Python MCP servers.