Anthropic or Claude

You can integrate b.well Health SDK for AI with Anthropic or Claude like this.

Pre-requisite

pip install anthropic

If you have already received a b.well user token from Identity Gateway

import anthropic

client = anthropic.Anthropic(api_key="{insert your anthropic key here}")

person_id = "{insert person id here}"
user_token = "{insert your user token here}"
mcp_fhir_agent_url = "https://mcpfhiragent.client-sandbox.icanbwell.com/fhir/"

response = client.beta.tools.messages.create(
    model="claude-sonnet-4-5",
    tools=[{
        "type": "url",
        "name": "bwell-mcp-fhir-agent",
        "url": mcp_fhir_agent_url,
        "authorization_token": user_token,
    }],
    messages=[
        {"role": "user", "content": f"Get Active Medications for person_id={person_id}"}
    ],
    betas=["mcp-client-2025-04-04"]
)

print(response.content)