返回市场
Azure-FHIR-MCP-服务器

Azure-FHIR-MCP-服务器

作者:erikhoward16 星标更新:2025-10-11

项目介绍

Azure AHDS FHIR MCP Server 🚀

Azure Health Data Services FHIR(快速医疗互操作资源)的模型上下文协议(MCP)服务器实现。此服务提供了一个与Azure FHIR服务器交互的标准接口,通过MCP工具实现医疗数据操作。

License Python Version MCP

安装 🛠️

安装步骤 📦

需要Python 3.13或更高版本。

使用pip安装包:

pip install azure-fhir-mcp-server

MCP配置 ⚙️

Claude Desktop配置

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
fhirUrlAzure FHIR服务器URL必填
clientIdOAuth2客户端ID必填
clientSecretOAuth2客户端密钥必填
tenantIdAzure AD租户ID必填

2 - 重启Claude Desktop。

可用工具 🔧

FHIR资源操作

  • 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。

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

许可证 ⚖️

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

这不是微软或Azure的官方产品。