Skip to content

Connect athenaOne to ChatGPT: Access Patient EHR and Clinical Data

Learn how to connect athenaOne to ChatGPT using a managed MCP server. Execute FHIR-compliant workflows, access clinical data, and automate EHR tasks.

Sidharth Verma Sidharth Verma · · 10 min read
Connect athenaOne to ChatGPT: Access Patient EHR and Clinical Data

If you need to connect athenaOne to ChatGPT to automate clinical data retrieval, manage FHIR resources, or orchestrate patient check-ins, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and athenaOne's massive REST API surface. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses Claude, check out our guide on connecting athenaOne to Claude or explore our broader architectural overview on connecting athenaOne to AI Agents.

Giving a Large Language Model (LLM) read and write access to a complex Electronic Health Record (EHR) system is a serious engineering undertaking. You have to handle deeply nested FHIR R4 payloads, map specific clinical coding systems to MCP tool definitions, and deal with strict pagination and scope requirements. Every time an endpoint changes or you need to expose a new clinical resource, your custom server code must be updated, redeployed, and audited.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for athenaOne, connect it natively to ChatGPT, and execute complex clinical workflows using natural language.

The Engineering Reality of the athenaOne API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against athenaOne's highly specific API is exceptionally painful.

If you decide to build a custom MCP server for athenaOne, you own the entire API lifecycle. Here are the specific integration challenges that break standard REST assumptions when working with athenaOne:

FHIR R4 Bundle Complexity

Unlike modern SaaS platforms that return simple flat JSON arrays for list endpoints, athenaOne heavily leverages the FHIR R4 standard. When you query for patients or medications, the API does not return a list of records. It returns a Bundle resource. The actual data you want is buried deep within the payload at entry.*.resource. If you pipe raw athenaOne responses directly to an LLM without flattening this structure, you quickly consume your context window with FHIR metadata wrapper objects, fullUrl strings, and search parameters.

athenaOne pagination does not rely on simple page=1 or offset=100 parameters. The FHIR Bundle contains a link array, where the object with relation: "next" provides a full URL containing an opaque cursor. Your MCP server must intercept tool calls from ChatGPT, extract the cursor from previous invocations, and pass it cleanly back to the upstream API. If the LLM attempts to hallucinate pagination parameters based on standard REST assumptions, the API will reject the request.

Asynchronous Bulk Exports and Polling

Certain high-value operations in athenaOne - like exporting patient populations - do not return data immediately. Instead, calling the $export operation returns an HTTP 202 Accepted with a Content-Location header. You must then poll that specific URL until the server responds with a manifest file containing URLs for the generated data. Teaching ChatGPT to execute this multi-step asynchronous polling loop requires specialized tool schemas that explicitly separate the kick-off trigger from the status check.

Factual Note on Rate Limits

It is critical to understand how rate limits function when routing traffic to athenaOne. Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream athenaOne API returns an HTTP 429 (Too Many Requests), Truto passes that error directly back to the caller (your MCP client or ChatGPT). Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. The caller is entirely responsible for implementing retry logic and backoff strategies.

How to Create an athenaOne MCP Server

Truto dynamically generates MCP tools from the athenaOne integration's documentation and resource definitions. You can spin up an MCP server scoped to a specific athenaOne account using either the Truto UI or the API.

Method 1: Via the Truto UI

For teams who prefer a visual setup, generating the server takes seconds:

  1. Navigate to the Integrated Accounts page in the Truto dashboard.
  2. Select your connected athenaOne account.
  3. Click the MCP Servers tab.
  4. Click Create MCP Server.
  5. Select your desired configuration (e.g., restrict to read methods, or filter by specific clinical tags).
  6. Copy the generated MCP server URL.

Method 2: Via the API

For platform engineers automating infrastructure, you can generate the MCP server programmatically. You need your Truto API token and the integrated_account_id for the athenaOne connection.

curl -X POST https://api.truto.one/integrated-account/<integrated_account_id>/mcp \
  -H "Authorization: Bearer <your_truto_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "athenaOne Clinical Assistant",
    "config": {
      "methods": ["read", "write", "custom"],
      "tags": ["patient", "clinical", "scheduling"]
    }
  }'

The API responds with a secure, tokenized URL:

{
  "id": "mcp_srv_8f9a2b1c",
  "name": "athenaOne Clinical Assistant",
  "config": { 
    "methods": ["read", "write", "custom"], 
    "tags": ["patient", "clinical", "scheduling"]
  },
  "expires_at": null,
  "url": "https://api.truto.one/mcp/t_a1b2c3d4e5f6g7h8i9j0"
}

This single URL (https://api.truto.one/mcp/...) handles all routing, schema generation, and authentication for ChatGPT. Treat the token in the URL as a secret.

How to Connect the MCP Server to ChatGPT

Once you have your Truto MCP URL, you can attach it to ChatGPT. You have two implementation paths depending on your deployment model.

Method A: Via the ChatGPT UI (Developer Mode)

If you are using a ChatGPT Pro, Plus, Business, Enterprise, or Education account, you can attach custom connectors directly:

  1. Open ChatGPT and go to Settings -> Apps -> Advanced settings.
  2. Enable Developer mode.
  3. Under MCP servers / Custom connectors, click to add a new server.
  4. Set the Name to "athenaOne (Truto)".
  5. Paste the Truto MCP URL into the Server URL field.
  6. Click Save.

ChatGPT will immediately handshake with the Truto endpoint, fetch the list of available athenaOne tools, and inject them into the model's context window.

Method B: Via Manual Config File (Local / Headless)

If you are running a local testing environment, using Claude Desktop, or orchestrating agents via code, you can configure the MCP server using Server-Sent Events (SSE) via the standard @modelcontextprotocol/server-sse package.

Create a configuration JSON file (e.g., athenaone-mcp.json):

{
  "mcpServers": {
    "athenaOne": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/t_a1b2c3d4e5f6g7h8i9j0"
      ]
    }
  }
}

This configuration instructs your local MCP client to connect to the Truto URL over HTTPS and dynamically load the athenaOne tool schemas.

Hero Tools for athenaOne

Truto automatically generates tools for every documented resource in athenaOne. Here are six high-leverage tools available immediately to your AI agents.

Read Patient

Retrieves a single patient record by its FHIR resource ID. This is the foundation for almost all clinical workflows.

Contextual Usage Notes: The ID required is the specific FHIR resource ID, not a legacy database key. The LLM receives the flattened FHIR Patient resource, containing demographic data, contact info, and identifiers.

"Fetch the patient record for FHIR ID 894522. I need to verify their primary address and date of birth before proceeding with the lab order."

Search Appointment

Searches the Appointment resource using standard FHIR search parameters.

Contextual Usage Notes: This tool pages along the Bundle's next link. Records are extracted from entry.*.resource. The LLM can use this to find all upcoming appointments for a specific patient or a specific location on a given date.

"Find all upcoming appointments scheduled for patient ID 894522 next week. Let me know the status of each and the practitioner assigned."

Read Observation

Fetches a specific clinical observation (like a lab result, vital sign, or social history data point) by its FHIR ID.

Contextual Usage Notes: Observations in athenaOne are highly structured. The LLM must be prepared to parse LOINC codes and value/quantity objects nested within the response payload.

"Get the clinical observation with ID 1048573. Extract the systolic and diastolic blood pressure readings from the component array and summarize them."

Search MedicationRequest

Queries the system for medication orders, prescriptions, or statements associated with a patient.

Contextual Usage Notes: Crucial for reconciling patient charts. The LLM receives the MedicationRequest resources, which detail the drug, dosage instructions, and requester.

"List all active medication requests for patient ID 894522. Are there any active prescriptions for Lisinopril or other ACE inhibitors?"

Read CarePlan

Retrieves a specific CarePlan resource detailing the clinical intent, goals, and planned activities for a patient.

Contextual Usage Notes: This endpoint is vital for chronic care management use cases. The tool returns the structured plan, which the LLM can analyze against recent observations to assess patient progress.

"Pull the care plan for ID 339210. Summarize the stated goals for diabetes management and list the specific activities the patient is supposed to complete."

Executes the custom $self-checkin-entry-url operation to generate a secure, temporary check-in link for a patient.

Contextual Usage Notes: This is a POST operation. The LLM must supply the appointment_id, patientId, brandId, and departmentId. The resulting link is usable for 1 week or 10 uses, making it perfect for automated pre-visit SMS campaigns.

"Generate a self check-in link for appointment ID 55829. Use patient ID 894522, brand ID 1, and department ID 4. Return just the URL so I can text it to the patient."

To view the complete inventory of available endpoints, parameters, and FHIR schemas, visit the athenaOne integration page.

Workflows in Action

When you connect athenaOne to ChatGPT via Truto, the LLM stops being a simple text generator and becomes an active participant in clinical and administrative operations. Here is how specific workflows execute in practice.

1. Clinical Data Summarization

Persona: Clinical Intake Coordinator / AI Scribe

"Review the chart for patient ID 77301. Pull their most recent appointments, check their active medications, and fetch their latest care plan. Write a one-paragraph summary of their current status for the physician."

Step-by-step execution:

  1. ChatGPT calls get_single_athena_one_patient_by_id to verify demographic data and confirm identity.
  2. ChatGPT calls list_all_athena_one_appointments with the patient ID to establish recent visit history.
  3. ChatGPT calls list_all_athena_one_medication_requests to gather the active drug list.
  4. ChatGPT calls list_all_athena_one_care_plans to retrieve the current treatment goals.
  5. The LLM synthesizes the JSON-RPC responses into a cohesive, human-readable clinical summary.

2. Automated Patient Check-in Orchestration

Persona: Front Office Automation Agent

"Find the 2:00 PM appointment today for patient ID 99214. If the status is 'booked', generate a self check-in link for department 12 (brand 1) so we can message it to them."

Step-by-step execution:

  1. ChatGPT calls list_all_athena_one_appointments applying a date filter and patient ID to locate the specific 2:00 PM slot.
  2. The LLM inspects the JSON payload to verify the status field equals booked.
  3. ChatGPT extracts the appointment ID and calls create_a_athena_one_appointment_checkin_link, passing the required parameters (appointment ID, patient ID, department ID, brand ID).
  4. ChatGPT receives the generated URL and outputs it to the user for dispatch.
sequenceDiagram
    participant User as User Prompt
    participant ChatGPT as ChatGPT
    participant MCP as Truto MCP Server
    participant Upstream as "athenaOne API"

    User->>ChatGPT: "Find 2PM appointment for ID 99214<br>and generate check-in link"
    ChatGPT->>MCP: Call list_all_athena_one_appointments(patient=99214, date=today)
    MCP->>Upstream: GET /fhir/r4/Appointment?patient=99214...
    Upstream-->>MCP: FHIR Bundle with 1 record
    MCP-->>ChatGPT: JSON-RPC result (status: booked, id: 8831)
    ChatGPT->>MCP: Call create_a_athena_one_appointment_checkin_link(id=8831...)
    MCP->>Upstream: POST /fhir/r4/Appointment/8831/$self-checkin-entry-url
    Upstream-->>MCP: Check-in URL payload
    MCP-->>ChatGPT: JSON-RPC result (URL)
    ChatGPT-->>User: "Here is the check-in link: https://..."

3. Asynchronous Bulk Export Monitoring

Persona: Population Health Analyst

"Kick off a bulk FHIR export for patient group ID 500. Check the status and tell me when the export manifest is ready for download."

Step-by-step execution:

  1. ChatGPT calls create_a_athena_one_group_export passing the group ID.
  2. Truto executes the $export operation, receives a 202 Accepted, and extracts the status URL from the Content-Location header.
  3. ChatGPT calls get_single_athena_one_bulk_export_status_by_id using the extracted status URL.
  4. If the export is still running, the LLM sees an empty result (representing the 202 status) and can wait or notify the user to check back. If complete, it reads the manifest file URLs.

Security and Access Control

Giving an LLM access to clinical data requires strict boundary enforcement. Truto MCP servers provide multiple layers of security to ensure AI agents only access what they explicitly require.

  • Method Filtering (config.methods): Restrict the server to specific operation types. Setting this to ["read"] ensures ChatGPT can only execute get and list tools, physically preventing the LLM from creating records or altering care plans.
  • Tag Filtering (config.tags): Scope the available tools to specific integration resources. You can restrict a server to only expose tools related to ["scheduling"] or ["billing"], completely hiding sensitive clinical resources like observations or conditions from the context window.
  • Dual Authentication (require_api_token_auth): By default, possessing the MCP URL grants access. By setting this flag to true, the MCP client must also pass a valid Truto API token in the Authorization header, adding a second layer of identity verification.
  • Ephemeral Servers (expires_at): Generate short-lived MCP servers for temporary workflows or contractor access. Once the ISO datetime is reached, the server is automatically cleaned up and all token routing is disabled.

Stop Building Boilerplate Integration Code

Connecting athenaOne to ChatGPT shouldn't require weeks of engineering time spent deciphering FHIR R4 Bundles, writing pagination logic, and manually defining JSON schemas for LLM tool calling.

By leveraging Truto's dynamically generated MCP servers, you can instantly transform athenaOne's massive API surface into curated, context-aware tools that ChatGPT can consume natively. You get complete control over security scopes, zero data retention in the integration layer, and immediate access to complex clinical workflows.

FAQ

Does Truto automatically handle athenaOne rate limits?
No. Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream athenaOne API returns an HTTP 429, Truto passes that error directly to the caller, normalizing the headers. The caller is responsible for retry logic.
How does the MCP server handle athenaOne's FHIR pagination?
athenaOne uses FHIR Bundles with 'next' links for pagination. The MCP tools automatically expose cursor properties to the LLM, instructing ChatGPT to pass the opaque cursor back in subsequent tool calls to fetch the next page of records.
Can I prevent ChatGPT from modifying patient records in athenaOne?
Yes. When creating the MCP server in Truto, you can configure method filtering by setting config.methods to ["read"]. This ensures the LLM only has access to safe GET and LIST operations, preventing any write actions.
Do I need to write custom JSON schemas for athenaOne tools?
No. Truto dynamically generates the MCP tool schemas directly from the athenaOne integration documentation and resource definitions, keeping the schemas in sync with the upstream API without manual coding.

More from our Blog