You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Description: Disables OAuth2-based authentication between the MCP client (e.g., Claude Desktop or VSCode) and the MCP server.
68
+
- Type: Flag (no value required)
69
+
- Default: False (authentication enabled)
70
+
71
+
- **--disable-fhir-auth**
72
+
- Description: Disables OAuth2-based authentication between the MCP server and the FHIR server.
73
+
- Type: Flag (no value required)
74
+
- Default: False (authentication enabled)
75
+
76
+
Sample Usages:
77
+
78
+
```shell
79
+
uv run fhir-mcp-server --transport streamable-http --log-level DEBUG --disable-mcp-auth --disable-fhir-auth
80
+
```
81
+
82
+
### Environment Variables
83
+
84
+
**MCP Server Configurations:**
85
+
- `HEALTHCARE_MCP_HOST`: The hostname or IP address the MCP server should bind to (e.g., 0.0.0.0 for all interfaces, or localhost for local-only access).
86
+
- `HEALTHCARE_MCP_PORT`: The port on which the MCP server will listen for incoming client requests (e.g., 8000).
87
+
88
+
**MCP Server OAuth2 Configuration (MCP Client ↔ MCP Server):**
89
+
These variables are used when securing communication between an MCP client (like Claude Desktop or VSCode) and the MCP server via OAuth2 Authorization Code Grant flow.
90
+
91
+
- `HEALTHCARE_MCP_OAUTH__CLIENT_ID`: The OAuth2 client ID registered with your Identity Provider to authenticate MCP clients.
92
+
- `HEALTHCARE_MCP_OAUTH__CLIENT_SECRET`: The OAuth2 client secret used to verify the MCP client during the token exchange process.
93
+
- `HEALTHCARE_MCP_OAUTH__METADATA_URL`: The URL to the Identity Provider’s OAuth2 discovery document (usually ending in .well-known/openid-configuration). Used to dynamically fetch token and authorization endpoints.
94
+
95
+
**FHIR Backend Configuration (MCP Server ↔ FHIR Server):**
96
+
These variables configure the MCP server’s secure connection with the FHIR backend using authorization code grant flow.
97
+
98
+
- `HEALTHCARE_MCP_FHIR__CLIENT_ID`: The OAuth2 client ID used by the MCP server to authenticate itself to the FHIR server.
99
+
- `HEALTHCARE_MCP_FHIR__CLIENT_SECRET`: The client secret corresponding to the FHIR client ID. Used during token exchange.
100
+
- `HEALTHCARE_MCP_FHIR__BASE_URL`: The base URL of the FHIR server (e.g., https://hapi.fhir.org/baseR4). This is used to generate tool URIs and to route FHIR requests.
101
+
- `HEALTHCARE_MCP_FHIR__SCOPE`: A space-separated list of OAuth2 scopes to request from the FHIR authorization server (e.g., user/Patient.read user/Observation.read).
102
+
103
+
104
+
## Usage
105
+
106
+
Run the server:
107
+
```bash
108
+
uv run fhir-mcp-server
109
+
```
110
+
111
+
You can also run the server directly from the PyPI package (without cloning the repository) using:
112
+
113
+
```bash
114
+
uvx fhir-mcp-server
115
+
```
116
+
117
+
Check available server options:
118
+
```bash
119
+
uvx run fhir-mcp-server --help
120
+
```
121
+
122
+
## Docker Setup
123
+
124
+
You can run the MCP server using Docker for a consistent, isolated environment.
125
+
126
+
### 1. Build the Docker Image
127
+
128
+
```bash
129
+
docker build -t fhir-mcp-server .
130
+
```
131
+
132
+
### 2. Configure Environment Variables
133
+
134
+
Copy the example environment file and edit as needed:
135
+
136
+
```bash
137
+
cp .env.example .env
138
+
# Edit .env to set your FHIR server, client credentials, etc.
139
+
```
140
+
141
+
Alternatively, you can pass environment variables directly with `-e` flags or use Docker secrets for sensitive values.
142
+
143
+
### 3. Run the Container
144
+
145
+
```bash
146
+
docker run --env-file .env -p 8000:8000 fhir-mcp-server
147
+
```
148
+
149
+
This will start the server and expose it on port 8000. Adjust the port mapping as needed.
150
+
50
151
## Development & Testing
51
152
52
153
### Installing Development Dependencies
@@ -56,7 +157,7 @@ To run tests and contribute to development, install the test dependencies:
56
157
**Using pip:**
57
158
```bash
58
159
# Install project in development mode with test dependencies
This will discover and run all tests in the `tests/` directory.
188
+
82
189
83
190
**Test Features:**
84
191
- 🧪 **100+ tests** with comprehensive coverage
@@ -95,25 +202,11 @@ The test suite includes:
95
202
96
203
Coverage reports are generated in`htmlcov/index.html` for detailed analysis.
97
204
98
-
## Usage
99
-
100
-
Run the server:
101
-
```bash
102
-
uv run fhir-mcp-server
103
-
```
104
-
105
-
You can also run the server directly from the PyPI package (without cloning the repository) using:
106
-
107
-
```bash
108
-
uvx fhir-mcp-server
109
-
```
205
+
## VS Code Integration
110
206
111
-
Check available server options:
112
-
```bash
113
-
uvx run fhir-mcp-server --help
114
-
```
207
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=fhir&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fmcp%2F%22%7D)
208
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=fhir&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fmcp%2F%22%7D)
115
209
116
-
## VS Code Integration
117
210
Add the following JSON block to your User Settings (JSON) file in VS Code (> V1.101). You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).
118
211
119
212
<table>
@@ -310,6 +403,14 @@ Once connected, MCP Inspector will allow you to visualize tool invocations, insp
310
403
- `searchParam`: A mapping of FHIR search parameter names to their desired values (e.g., {"category":"laboratory","issued:"2025-05-01"}).
311
404
- `operation`: The name of a custom FHIR operation or extended query defined for the resource (e.g., "$expand").
312
405
406
+
## Screenshots
407
+
408
+
### EPIC FHIR Integration
409
+
410
+
| User Enters a Query | User Authenticates | User Grants Consent | LLM Displays the Response |
0 commit comments