# FHIR MCP Server

> FHIR MCP Server is an open-source MCP server for health and science. Let AI assistants search and read FHIR healthcare records with SMART-on-FHIR login. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Repository:** https://github.com/wso2/fhir-mcp-server
- **MCP Registry name:** io.github.wso2/fhir-mcp-server
- **Categories:** [health and science](https://ai-powered.com/categories/health-and-science), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Point this server at any FHIR API through the FHIR_SERVER_BASE_URL setting (the registry example is the public HAPI R5 test server) and an MCP client can search, retrieve and analyse clinical resources. It is published by WSO2 and installs from PyPI with uvx, from source with uv, or as a container image from GitHub Container Registry.

Authorization follows SMART-on-FHIR and is on by default; set a client ID, secret and scopes, or switch it off for open servers. The README demonstrates both an unauthenticated HAPI FHIR server and the full OAuth 2.0 authorization code flow against the Epic sandbox. Results from read and search calls can be trimmed with FHIRPath expressions, which keeps payloads small for the model.

Transports are stdio, SSE and streamable HTTP, with the HTTP listener on localhost:8000 unless FHIR_MCP_HOST and FHIR_MCP_PORT change it. A docker-compose file also starts a WSO2 FHIR server backed by PostgreSQL for a quick test setup. The README notes that authorization should be disabled when the container runs locally.

## Features

- **SMART-on-FHIR auth:** Authenticates against FHIR servers using client ID, secret and scopes, enabled by default.
- **FHIRPath response filtering:** Limits read and search results to the fields a task needs.
- **Three transports:** Serves over stdio, SSE or streamable HTTP.
- **Docker compose test stack:** Starts the MCP server beside a WSO2 FHIR server and PostgreSQL.
- **Works with common clients:** Documented for VS Code, Claude Desktop and MCP Inspector.

## Good for

- Search patient resources on a FHIR test server
- Retrieve and summarise clinical records for a prototype
- Try an Epic sandbox OAuth flow from an AI client
- Cut large FHIR bundles down with FHIRPath before the model reads them

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add fhir-mcp-server --env FHIR_SERVER_BASE_URL='<FHIR_SERVER_BASE_URL>' -- uvx fhir-mcp-server
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add fhir-mcp-server --env FHIR_SERVER_BASE_URL='<FHIR_SERVER_BASE_URL>' -- uvx fhir-mcp-server
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.fhir-mcp-server]
command = "uvx"
args = ["fhir-mcp-server"]
env = { FHIR_SERVER_BASE_URL = "<FHIR_SERVER_BASE_URL>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e FHIR_SERVER_BASE_URL='<FHIR_SERVER_BASE_URL>' fhir-mcp-server uvx -- fhir-mcp-server

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "fhir-mcp-server": {
      "command": "uvx",
      "args": [
        "fhir-mcp-server"
      ],
      "env": {
        "FHIR_SERVER_BASE_URL": "<FHIR_SERVER_BASE_URL>"
      }
    }
  }
}
```

## FAQ

### What is required to run FHIR MCP Server?

Python 3.8 or newer, uv, and a reachable FHIR server whose base URL goes in FHIR_SERVER_BASE_URL.

### Can I use FHIR MCP Server without logging in?

Yes. Set FHIR_SERVER_DISABLE_AUTHORIZATION to True for open servers such as the public HAPI FHIR server.

### How do I install FHIR MCP Server?

Run uvx fhir-mcp-server, install from source with uv, or pull ghcr.io/wso2/fhir-mcp-server.

### Which port does FHIR MCP Server use?

Localhost port 8000 by default, configurable with FHIR_MCP_HOST and FHIR_MCP_PORT.

### Is FHIR MCP Server free?

Yes. FHIR MCP Server is open source, so you can use and self-host it for free.

### How do I add FHIR MCP Server to Claude Code?

Run this command in your terminal: claude mcp add fhir-mcp-server --env FHIR_SERVER_BASE_URL='<FHIR_SERVER_BASE_URL>' -- uvx fhir-mcp-server

### What are the best alternatives to FHIR MCP Server?

The closest alternatives to FHIR MCP Server are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/fhir-mcp-server
