e

erikhoward

health-and-wellnessdatabasescloud-platforms

293 查看 · 2026-07-07 更新

Azure AHDS FHIR MCP 服务器 🚀

这是一个为 Azure Health Data Services FHIR(Fast Healthcare Interoperability Resources)实现的模型上下文协议(MCP)服务器。该服务提供了一个标准化接口,用于与 Azure FHIR 服务器交互,通过 MCP 工具实现医疗数据操作。

License Python Version MCP

设置 🛠️

安装 📦

需要 Python 3.13 或更高版本以及 uv

首先安装 uv

MCP 配置 ⚙️

Claude 桌面配置

1 - 编辑 Claude 桌面配置:

打开 claude_desktop_config.json 并添加以下配置。

在 MacOS 上,文件位于这里:~/Library/Application Support/Claude Desktop/claude_desktop_config.json

在 Windows 上,文件位于这里:%APPDATA%Claude Desktopclaude_desktop_config.json

json { "mcpServers": { "fhir": { "command": "uvx", "args": [ "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
fhirUrlAzure FHIR 服务器 URL必填
clientIdOAuth2 客户端 ID必填
clientSecretOAuth2 客户端密钥必填
tenantIdAzure AD 租户 ID必填

2 - 重启 Claude 桌面。

可用工具 🔧

FHIR 资源操作

  • search_fhir - 根据搜索参数字典搜索 FHIR 资源

资源访问

服务器通过 MCP 资源协议提供了对所有标准 FHIR 资源的访问:

  • fhir://Patient/ - 访问所有 Patient 资源
  • fhir://Patient/{id} - 访问特定的 Patient 资源
  • fhir://Observation/ - 访问所有 Observation 资源
  • fhir://Observation/{id} - 访问特定的 Observation 资源
  • fhir://Medication/ - 访问所有 Medication 资源
  • fhir://Medication/{id} - 访问特定的 Medication 资源
  • 还有很多...

开发 💻

本地开发设置

1 - 克隆仓库:

bash git clone https://github.com/erikhoward/azure-fhir-mcp-server.git cd azure-fhir-mcp-server

2 - 创建并激活虚拟环境:

Linux/macOS:

bash python -m venv .venv source .venv/bin/activate

Windows:

bash python -m venv .venv .venvScriptsactivate

3 - 安装依赖项:

bash pip install -e ".[dev]"

4 - 复制并配置环境变量:

bash cp .env.example .env

编辑 .env 文件以使用您的设置:

env fhirUrl=https://your-fhir-server.azurehealthcareapis.com/fhir clientId=your-client-id clientSecret=your-client-secret tenantId=your-tenant-id

5 - Claude 桌面配置

打开 claude_desktop_config.json 并添加以下配置。

在 MacOS 上,文件位于这里:~/Library/Application Support/Claude Desktop/claude_desktop_config.json

在 Windows 上,文件位于这里:%APPDATA%Claude Desktopclaude_desktop_config.json

json { "mcpServers": { "fhir": { "command": "uv", "args": [ "--directory", "/path/to/azure-fhir-mcp-server/repo", "run", "azure_fhir_mcp_server" ], "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。

  1. 叉分(Fork)仓库
  2. 创建你的功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交你的更改 (git commit -m '✨ Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 打开一个Pull Request

许可证 ⚖️

根据MIT许可发布 - 查看 LICENSE.md 文件。

这不是官方的Microsoft或Azure产品。

工具列表

  • search_fhir: nSearch for FHIR resources based on search parameters.nnArgs:n resource_type: The FHIR resource type to search (e.g., Patient , Observation )n search_params: Dictionary of search parameters to applyn ctx: MCP Context for logging and progress reportingnnReturns:n List of matching resourcesn

服务配置

[{'mcpServers': {'fhir': {'args': ['azure-fhir-mcp-server'], 'command': 'uvx', 'env': {'LOG_LEVEL': 'INFO', 'clientId': 'your-client-id', 'clientSecret': 'your-client-secret', 'fhirUrl': 'https://your-fhir-server.azurehealthcareapis.com/fhir', 'tenantId': 'your-tenant-id'}}}}, {'mcpServers': {'fhir': {'args': ['--directory', '/path/to/azure-fhir-mcp-server/repo', 'run', 'azure_fhir_mcp_server'], 'command': 'uv', 'env': {'LOG_LEVEL': 'DEBUG', 'clientId': 'your-client-id', 'clientSecret': 'your-client-secret', 'fhirUrl': 'https://your-fhir-server.azurehealthcareapis.com/fhir', 'tenantId': 'your-tenant-id'}}}}]

来源