@ncodeuy/medplum-mcp 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# @ncodeuy/medplum-mcp
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that provides access to [Medplum](https://www.medplum.com/) FHIR healthcare data. It enables Claude and other MCP clients to read, search, and query FHIR resources from one or more Medplum environments.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-environment support** — connect to multiple Medplum projects (e.g. dev, staging, production) and switch between them per request
|
|
8
|
+
- **30 FHIR resource types** — Patient, Practitioner, Observation, Condition, MedicationRequest, and more
|
|
9
|
+
- **Search with parameters** — query resources using standard FHIR search parameters
|
|
10
|
+
- **Resource history** — view version history of any resource with pagination
|
|
11
|
+
|
|
12
|
+
## Tools
|
|
13
|
+
|
|
14
|
+
The server exposes 5 MCP tools:
|
|
15
|
+
|
|
16
|
+
| Tool | Description |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `fhir_get_environments` | List available Medplum environments and the default |
|
|
19
|
+
| `fhir_get_resource_types` | List supported FHIR resource types and their search parameters |
|
|
20
|
+
| `fhir_read` | Read a single FHIR resource by type and ID |
|
|
21
|
+
| `fhir_search` | Search for FHIR resources with query parameters |
|
|
22
|
+
| `fhir_read_history` | Get version history of a resource |
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
25
|
+
|
|
26
|
+
### Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @ncodeuy/medplum-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Configure
|
|
33
|
+
|
|
34
|
+
The server reads configuration from environment variables. There are two options:
|
|
35
|
+
|
|
36
|
+
#### Multi-project (recommended)
|
|
37
|
+
|
|
38
|
+
Set `MEDPLUM_PROJECTS` as a JSON object mapping environment names to their connection details:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
MEDPLUM_PROJECTS='{
|
|
42
|
+
"staging": {
|
|
43
|
+
"baseUrl": "https://staging.example.com/",
|
|
44
|
+
"clientId": "staging-client-id",
|
|
45
|
+
"clientSecret": "staging-secret",
|
|
46
|
+
"projectId": "proj-staging"
|
|
47
|
+
},
|
|
48
|
+
"production": {
|
|
49
|
+
"baseUrl": "https://api.medplum.com/",
|
|
50
|
+
"clientId": "prod-client-id",
|
|
51
|
+
"clientSecret": "prod-secret",
|
|
52
|
+
"projectId": "proj-prod"
|
|
53
|
+
}
|
|
54
|
+
}'
|
|
55
|
+
MEDPLUM_DEFAULT_PROJECT=staging
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`MEDPLUM_DEFAULT_PROJECT` is optional and defaults to the first entry.
|
|
59
|
+
|
|
60
|
+
#### Single project (legacy)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
MEDPLUM_CLIENT_ID=your-client-id
|
|
64
|
+
MEDPLUM_CLIENT_SECRET=your-client-secret
|
|
65
|
+
MEDPLUM_BASE_URL=https://api.medplum.com/ # optional, this is the default
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Use with Claude Desktop
|
|
69
|
+
|
|
70
|
+
Add the server to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"medplum": {
|
|
76
|
+
"command": "npx",
|
|
77
|
+
"args": ["@ncodeuy/medplum-mcp"],
|
|
78
|
+
"env": {
|
|
79
|
+
"MEDPLUM_CLIENT_ID": "your-client-id",
|
|
80
|
+
"MEDPLUM_CLIENT_SECRET": "your-client-secret"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Use with Claude Code
|
|
88
|
+
|
|
89
|
+
Add the server to your Claude Code MCP settings:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add medplum -- npx @ncodeuy/medplum-mcp
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Then set the required environment variables in your shell before launching Claude Code.
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Install dependencies
|
|
101
|
+
npm install
|
|
102
|
+
|
|
103
|
+
# Type check
|
|
104
|
+
npm run typecheck
|
|
105
|
+
|
|
106
|
+
# Run tests
|
|
107
|
+
npm test
|
|
108
|
+
|
|
109
|
+
# Build
|
|
110
|
+
npm run build
|
|
111
|
+
|
|
112
|
+
# Run the server locally
|
|
113
|
+
node ./dist/index.js
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
ISC
|