# FHIR MCP Server

Connect an AI coding client to a FHIR API to search and retrieve clinical data. Use it when you need FHIR access from Claude Code or another supported client.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 136
- Author: wso2
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wso2/fhir-mcp-server
- Updated: 2026-10-12
- HTML: https://affpapa.org/en/nevibecode/mcp/fhir-mcp-server

## What it does

This server connects MCP clients to FHIR APIs over stdio, SSE, or streamable HTTP. Results from `read` and `search` can be narrowed with FHIRPath expressions. You need an accessible FHIR API, Python 3.8+, and `uv` for dependency management.

To run the PyPI package, set `FHIR_SERVER_BASE_URL` and launch `uvx fhir-mcp-server`. Authorization starts enabled; configure `FHIR_SERVER_CLIENT_ID`, `FHIR_SERVER_CLIENT_SECRET`, and `FHIR_SERVER_SCOPES` for it. Local Docker and Docker Compose runs require `FHIR_SERVER_DISABLE_AUTHORIZATION=True`; otherwise authorization prevents the documented local setup from working.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `FHIR_SERVER_BASE_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add fhir-mcp-server -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-server
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>

### Codex

**Platform CLI**
```bash
codex mcp add fhir-mcp-server --env FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> -- uvx fhir-mcp-server
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "fhir-mcp-server": {
            "command": "uvx",
            "args": [
                "fhir-mcp-server"
            ],
            "env": {
                "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "fhir-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "fhir-mcp-server"
            ],
            "env": {
                "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e FHIR_SERVER_BASE_URL=<FHIR_SERVER_BASE_URL> fhir-mcp-server uvx fhir-mcp-server
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from fhir-mcp-server <command>

## When to use it
- connect an AI client to a FHIR API
- search clinical resources on a FHIR server
- retrieve FHIR data with the `read` operation
- filter resource fields with FHIRPath

## Example prompts
- Search the connected FHIR server for patient resources matching these criteria.
- Retrieve this resource from FHIR and return only the fields needed for the task.
- Search for resources and filter the results with a FHIRPath expression.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
