Connect Healthie to ChatGPT: Automate Charting and Billing Cycles
Learn how to connect Healthie to ChatGPT using Truto's managed MCP Server. Automate EHR charting, billing cycles, and patient management with secure AI agents.
If you need to connect Healthie to ChatGPT to automate clinical charting, orchestrate billing cycles, or manage patient intake, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's JSON-RPC tool calls and Healthie's highly complex backend infrastructure. You can either spend months building and maintaining this integration layer in-house, or you can use a managed platform like Truto to dynamically generate a secure, authenticated MCP server URL.
If your team uses Claude, check out our guide on connecting Healthie to Claude or explore our broader architectural overview on connecting Healthie to AI Agents.
Giving a Large Language Model (LLM) read and write access to an Electronic Health Record (EHR) and practice management system like Healthie is a severe engineering challenge. You are not just pushing flat JSON; you are dealing with deeply nested clinical data, strict compliance boundaries, and a very specific API architecture. Every time a provider adds a new custom charting template or modifies an intake flow, your custom server code must be updated, tested, and redeployed.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Healthie, connect it natively to ChatGPT, and execute complex clinical and financial workflows using natural language.
The Engineering Reality of the Healthie API
A custom MCP server is essentially a self-hosted integration middleware. While the open MCP standard provides a predictable way for models to discover tools, implementing it against Healthie's specific API surface is exceptionally difficult.
If you decide to build a custom MCP server for Healthie, you own the entire API lifecycle. Here are the specific integration challenges you will face:
The 2000-Point GraphQL Complexity Cap
Healthie relies heavily on a GraphQL API. While GraphQL is fantastic for fetching exactly what you need, it is highly dangerous to expose directly to a non-deterministic LLM. Healthie enforces a strict 2000-point complexity cap per query. Certain nested objects - like querying an appointment and requesting the nested zoom_appointment, zoom_cloud_recording_files, or zoom_dial_in_info - cost hundreds of points each. If you give an LLM raw GraphQL access, it will inevitably hallucinate a deeply nested query that immediately blows past the 2000-point limit, resulting in a crashed workflow and a failed agent action. Truto's MCP tools pre-define these boundaries as REST-like operations, abstracting away the GraphQL complexity limit so your agent never triggers a query failure.
Idiosyncratic Webhooks and Pagination
Healthie returns paginated data, but the LLM has zero concept of how to manage state across pages. When querying objects like chartNotes or appointments, Healthie requires specific cursor tracking (first / after). If an LLM needs to find a specific billing record from three months ago, it cannot easily page through 50 records at a time on its own. Your custom MCP server must implement logic to either flatten the pagination or translate the LLM's query into the correct cursor references.
Fragmented Object Linking
Many advanced Healthie workflows require linking fragmented objects together. For example, attaching an external DoseSpot prescription to a chart note requires precise tracking of the external_prescription_identifier and the form_answer_group_id. An LLM cannot intuit these strict relational rules just from reading standard API schemas. It requires highly curated tool definitions that explicitly map out these relationships.
Generating the Healthie MCP Server with Truto
Instead of writing and hosting custom GraphQL translation layers, you can use Truto to generate an MCP server instantly. Truto abstracts Healthie's entire API into REST-based Proxy APIs, which are then dynamically translated into MCP tool definitions.
There are two ways to generate your Healthie MCP server in Truto: via the Dashboard UI or via the API.
Method 1: Via the Truto UI
For administrators and non-technical team members, generating the server takes only a few clicks:
- Log into your Truto dashboard and navigate to the Integrated Accounts page.
- Select your connected Healthie account.
- Click on the MCP Servers tab.
- Click the Create MCP Server button.
- Configure your server: assign a human-readable name (e.g., "ChatGPT Clinical Assistant"), and select the desired configuration. You can restrict the AI to read-only methods or filter tools by specific tags (like
billingorcharting). - Click Save and copy the generated MCP server URL.
This single URL contains a cryptographic token that securely routes requests directly to your specific Healthie instance.
Method 2: Via the Truto API
For engineering teams building programmatic multi-tenant AI products, you can generate MCP servers on the fly using Truto's API. This is critical if you are deploying AI agents for hundreds of different medical practices, each requiring their own scoped Healthie access.
Make a POST request to /integrated-account/:id/mcp:
curl -X POST https://api.truto.one/integrated-account/$HEALTHIE_ACCOUNT_ID/mcp \
-H "Authorization: Bearer $TRUTO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "ChatGPT Billing Agent",
"config": {
"methods": ["read", "write"],
"tags": ["billing", "appointments", "super_bills"]
},
"expires_at": "2026-12-31T23:59:59Z"
}'The API will return a JSON object containing the secure URL:
{
"id": "mcp_abc123",
"name": "ChatGPT Billing Agent",
"url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}Treat this url as a sensitive secret. It carries the routing and authentication context required to execute actions against Healthie.
Connecting the MCP Server to ChatGPT
Once you have your Truto MCP server URL, you must register it with your ChatGPT environment. You can do this visually through the ChatGPT interface, or programmatically if you are running a custom ChatGPT-compatible client.
Option A: Via the ChatGPT UI
If you are using ChatGPT Pro, Plus, Business, Enterprise, or Education accounts, you can add custom connectors directly in the browser or desktop app:
- Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
- Toggle Developer mode to ON.
- Under the MCP servers / Custom connectors section, click to add a new server.
- Enter a descriptive name (e.g., "Healthie (Truto)").
- Paste the Truto MCP URL you generated in the previous step into the Server URL field.
- Click Save.
ChatGPT will immediately ping the server, run the initialization handshake, and list all the available Healthie tools to the model.
Option B: Via Manual Config File (SSE Transport)
If you are integrating into a custom desktop agent, CLI, or an open-source MCP client framework that requires manual configuration files, you can configure the Server-Sent Events (SSE) transport manually.
Since Truto exposes the MCP server over standard HTTP via JSON-RPC, you can proxy it using the standard @modelcontextprotocol/server-sse package.
{
"mcpServers": {
"healthie-truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/a1b2c3d4e5f6..."
]
}
}
}Healthie Hero Tools for AI Agents
When you connect Healthie to ChatGPT via Truto, the model instantly gains access to Healthie's resources. Truto dynamically curates these tools to ensure the LLM has all the required context. Below are 6 high-leverage hero tools that transform ChatGPT into a powerful clinical and administrative agent.
1. list_all_healthie_chart_notes
This tool allows the agent to pull down historical chart notes for a patient. Because EHR charting is incredibly dense, this is critical for generating patient summaries before a visit.
"Fetch the last 3 chart notes for patient ID 88472 and summarize their primary complaints and the prescribed care plan."
2. create_a_healthie_super_bill
Superbills require a massive amount of specific data: CPT codes, ICD-10 codes, rendering provider NPIs, and service locations. This tool lets ChatGPT assemble these complex records dynamically after analyzing a consultation transcript.
"Generate a superbill for today's appointment with John Doe. Use CPT code 99213 and ICD-10 code E11.9. Set the rendering provider to Dr. Smith."
3. create_a_healthie_care_plan
Care plans are living documents. This tool empowers ChatGPT to synthesize lab results, patient messages, and provider notes into a structured care plan object that the patient can view in their portal.
"Create a new care plan for Sarah Jenkins based on her latest lab results. Include a daily target of 80g of protein and assign the 'Basic Hydration' sub-goal."
4. list_all_healthie_lab_orders
Fetching lab orders is essential for diagnostic workflows. ChatGPT can query this tool to check the status of pending panels or retrieve historical results for comparison.
"Check the status of the recent lipid panel lab order for patient ID 99231. If it is marked complete, summarize the results."
5. healthie_checkouts_complete
Healthie handles billing and scheduling checkouts as a distinct mutation. This tool allows the agent to finalize the booking or buying process, effectively closing the loop on patient intake.
"Finalize the checkout process for Mark's upcoming dietician appointment. Ensure the correct offering package ID is applied."
6. healthie_prescription_to_chart_notes_attach
EHRs often fragment data. This specific tool links a DoseSpot prescription directly to a specific chart note, ensuring the clinical record accurately reflects the medical intervention.
"Link the external prescription identifier X992-RX to the form answer group ID for today's chart note so the file is complete."
For the complete inventory of available Healthie tools, including specific JSON schema definitions for queries and bodies, visit the Healthie integration page.
Workflows in Action
Once ChatGPT has access to the Healthie MCP server, you can orchestrate multi-step automations. Because the LLM understands the schema, it can chain these tools together without hardcoded scripts.
Workflow 1: Post-Consultation Charting & Superbill Generation
Administrative overhead is a massive burden in healthcare. ChatGPT can automate the documentation and billing staging immediately following a consultation.
"Review my raw consultation notes from my session with Jane Smith. Draft a new chart note using our standard SOAP template. Once the note is created, generate a superbill for the visit using CPT 99214 and the appropriate ICD-10 code for hypertension."
list_all_healthie_appointments: ChatGPT queries today's schedule to find the exact appointment and patient ID for Jane Smith.create_a_healthie_charting_note(using standard custom module forms): The agent synthesizes the raw text into a SOAP structure and pushes the note to the patient's file.create_a_healthie_super_bill: The agent maps the clinical data to standard medical codes and generates the billing artifact for the back office to review.
flowchart TD
A["Raw Notes Provided"] --> B["list_all_healthie_appointments<br>Find Patient ID"]
B --> C["create_a_healthie_note<br>Draft SOAP Note"]
C --> D["create_a_healthie_super_bill<br>Generate Billing Artifact"]
D --> E["Workflow Complete"]Workflow 2: Lab Result Retrieval and Care Plan Update
When lab results arrive, providers must manually update patient instructions. ChatGPT can proactively monitor and update these records.
"Check all pending lab orders for my patients. For any that are complete, fetch the results, update their active care plan with new dietary recommendations, and draft a direct message to the patient explaining the changes."
list_all_healthie_lab_orders: The agent requests all lab orders, filtering for those with acompletestatus.list_all_healthie_care_plans: For a specific patient, it fetches their currently active care plan.update_a_healthie_care_plan_by_id: The agent modifies the plan to reflect the new clinical reality (e.g., adding iron supplements based on a low ferritin result).create_a_healthie_conversationorcreate_a_healthie_note: The agent drafts the patient communication for provider review.
sequenceDiagram
participant User as User (Provider)
participant ChatGPT as ChatGPT
participant Healthie as Healthie API via MCP
User->>ChatGPT: Check pending labs and update care plans
ChatGPT->>Healthie: Call list_all_healthie_lab_orders
Healthie-->>ChatGPT: Returns completed lipid panels
ChatGPT->>Healthie: Call list_all_healthie_care_plans
Healthie-->>ChatGPT: Returns active care plan ID
ChatGPT->>Healthie: Call update_a_healthie_care_plan_by_id
Healthie-->>ChatGPT: Confirms plan update
ChatGPT-->>User: Outputs summary of changesSecurity and Access Control
Giving an AI agent access to electronic health records requires strict governance. Truto's MCP servers provide granular controls to limit the blast radius of any LLM action.
- Method Filtering: You can configure the
config.methodsarray to only allow["read"]operations. This ensures ChatGPT can view patient histories but cannot mutate charts, delete superbills, or alter care plans. - Tag Filtering: By configuring
config.tags(e.g.,["billing"]), you can restrict the server to only expose tools related to invoices and superbills, keeping the agent out of clinical notes. - Require API Token Auth: Setting
require_api_token_auth: trueforces the client to pass a valid Truto API token in theAuthorizationheader. The MCP URL alone is no longer enough to execute a tool. - Temporary Access: Using the
expires_atfield, you can create short-lived servers (e.g., expiring in 24 hours) for contractor or temporary agent usage. Truto automatically destroys the token and routing context when the time expires.
A Note on Rate Limits and Error Handling
When automating API requests with AI, rate limiting is a critical consideration. Truto does not retry, throttle, or apply backoff on rate limit errors.
If ChatGPT makes too many concurrent tool calls and Healthie returns an HTTP 429 Too Many Requests error, Truto passes that 429 error directly back to the caller. However, Truto standardizes the upstream rate limit information into IETF-compliant HTTP headers: ratelimit-limit, ratelimit-remaining, and ratelimit-reset. Your agent framework (or ChatGPT itself) is responsible for interpreting these headers and executing the appropriate backoff strategy.
Wrap Up
Connecting Healthie to ChatGPT fundamentally changes how healthcare administration is performed. By moving away from brittle, point-to-point scripts and embracing the Model Context Protocol, you allow the AI to read schemas dynamically, adapt to changing patient data, and execute complex workflows autonomously. With Truto handling the complex GraphQL translations, secure token exchange, and dynamic tool generation, your engineering team can focus on prompt engineering and agent logic rather than debugging API payloads.
FAQ
- How do I connect Healthie to ChatGPT?
- You can connect Healthie to ChatGPT by generating a Model Context Protocol (MCP) server URL using Truto, and then pasting that URL into ChatGPT's custom connectors settings (under Developer mode).
- Does Truto automatically handle Healthie's API rate limits?
- No. Truto normalizes rate limit headers into the IETF standard, but it passes HTTP 429 errors directly to the caller. Your AI agent or client application is responsible for implementing retry and backoff logic.
- Can I restrict which Healthie data ChatGPT can access?
- Yes. When generating the MCP server in Truto, you can use method and tag filters to restrict the AI to specific actions, such as read-only access or limiting access to specific resources like billing or scheduling.