Azure Health Data Services FHIR(快速医疗互操作资源)的模型上下文协议(MCP)服务器实现。此服务提供了一个与Azure FHIR服务器交互的标准接口,通过MCP工具实现医疗数据操作。
需要Python 3.13或更高版本。
使用pip安装包:
pip install azure-fhir-mcp-server
1 - 编辑Claude Desktop配置:
打开claude_desktop_config.json并添加以下配置。
在MacOs中,文件位于:~/Library/Application Support/Claude Desktop/claude_desktop_config.json。
在Windows中,文件位于:%APPDATA%\Claude Desktop\claude_desktop_config.json。
{
"mcpServers": {
"fhir": {
"command": "azure-fhir-mcp-server",
"env": {
"LOG_LEVEL": "INFO",
"fhirUrl": "https://your-fhir-server.azurehealthcareapis.com/fhir",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"tenantId": "your-tenant-id"
}
}
}
}
以下是可用环境配置变量的表格:
| 变量 | 描述 | 默认值 |
|---|---|---|
LOG_LEVEL | 日志级别 | INFO |
fhirUrl | Azure FHIR服务器URL | 必填 |
clientId | OAuth2客户端ID | 必填 |
clientSecret | OAuth2客户端密钥 | 必填 |
tenantId | Azure AD租户ID | 必填 |
2 - 重启Claude Desktop。
search_fhir - 根据搜索参数字典搜索FHIR资源服务器通过MCP资源协议提供对所有标准FHIR资源的访问:
fhir://Patient/ - 访问所有患者资源fhir://Patient/{id} - 访问特定患者资源fhir://Observation/ - 访问所有观察资源fhir://Observation/{id} - 访问特定观察资源fhir://Medication/ - 访问所有药物资源f_hir://Medication/{id} - 访问特定药物资源1 - 克隆仓库:
git clone https://github.com/erikhoward/azure-fhir-mcp-server.git
cd azure-fhir-mcp-server
2 - 创建并激活虚拟环境:
Linux/macOS:
python -m venv .venv
source .venv/bin/activate
Windows:
python -m venv .venv
.venv\Scripts\activate
3 - 安装依赖项:
pip install -e ".[dev]"
4 - 复制并配置环境变量:
cp .env.example .env
编辑.env文件以包含您的设置:
fhirUrl=https://your-fhir-server.azurehealthcareapis.com/fhir
clientId=your-client-id
clientSecret=your-client-secret
tenantId=your-tenant-id
5 - Claude Desktop配置
打开claude_desktop_config.json并添加以下配置。
在MacOs中,文件位于:~/Library/Application Support/Claude Desktop/claude_desktop_config.json。
在Windows中,文件位于:%APPDATA%\Claude Desktop\claude_desktop_config.json。
{
"mcpServers": {
"fhir": {
"command": "python",
"args": [
"-m",
"fhir_mcp_server.server"
],
"cwd": "/path/to/azure-fhir-mcp-server/repo",
"env": {
"LOG_LEVEL": "DEBUG",
"fhirUrl": "https://your-fhir-server.azurehealthcareapis.com/fhir",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"tenantId": "your-tenant-id"
}
}
}
}
6 - 重启Claude Desktop。
欢迎贡献!请随时提交Pull Request。
git checkout -b feature/AmazingFeature)git commit -m '✨ 添加一些AmazingFeature')git push origin feature/AmazingFeature)根据MIT许可 - 查看LICENSE.md文件。
这不是微软或Azure的官方产品。