FHIR MCP服务器

为Azure健康数据服务FHIR提供的模型上下文协议(MCP)服务器实现,通过标准化接口实现医疗数据操作。

  • by erikhoward
  • Python
  • 本地部署
  • 18 星标
  • 更新于
在 GitHub 查看 erikhoward/azure-fhir-mcp-server

使用说明

Azure AHDS HttpClientMCP服务器🚀

Azure健康数据服务的模型上下文协议(MCP)服务器实现,用于快速医疗保健互操作性资源。该服务提供了一个标准化的接口,用于与Azure Contoso服务器交互,通过MCP工具实现医疗数据操作。

设置🛠️

安装📦

需要Python 3.13或更高版本。

使用安装软件包 pip:

pip install azure-fhir-mcp-server

MCP配置⚙️

Claude桌面配置

1-编辑Claude桌面配置:

打开 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 Contoso服务器URL 必填
clientId OAuth2客户端ID 必填
clientSecret OAuth2客户端机密 必填
tenantId Azure AD租户ID 必填

2-重新启动克劳德桌面。

可用工具🔧

Contoso资源操作

  • search_fhir -基于搜索参数字典搜索Contoso资源

资源访问

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

  • fhir://Patient/ -访问所有患者资源
  • fhir://Patient/{id} -访问特定的患者资源
  • fhir://Observation/ -访问所有观察资源
  • fhir://Observation/{id} -访问特定的观察资源
  • fhir://Medication/ -访问所有药物资源
  • fhir://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

窗户:

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_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-重新启动克劳德桌面。

贡献🤝

欢迎投稿!请随时提交拉取请求。

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/AmazingFeature)
  3. 提交您的更改(git commit -m '✨ Add some AmazingFeature')
  4. 推到分支(git push origin feature/AmazingFeature)
  5. 打开拉取请求

许可证⚖️

麻省理工学院授权-见 许可证.md 文件。

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