# Build with AI

Page: https://aws-sandbox.myclaimhouse.com/docs/build-with-ai

Claim House is built to be used by AI tools as well as by people. Connect the MCP server and Claude, Cursor or your own agent can do everything the API does with your test key; give it the OpenAPI document and the markdown docs and it can write a working integration without anyone reading X12. If your system already speaks X12, [SFTP for batch partners](https://aws-sandbox.myclaimhouse.com/docs/sftp.md) takes its 837D files directly, and the same account is managed with the `sftp` tools below.

## MCP server

The MCP server lets an AI tool (Claude, Cursor or your own agent) do everything the API does: find payers, keep offices and providers, run eligibility checks, send claims, upload attachments, read ERAs, manage webhooks and read usage. It has a tool for every API endpoint and a few that explain answers, with the same API key, permissions, validation, idempotency and errors as the API.

Connect to `https://aws-sandbox.myclaimhouse.com/api/mcp` over streamable HTTP and send your API key as a bearer token in the `Authorization` header. Keep the key in an environment variable or your client's secret store, never in a file you share.

**Claude Code**

```bash
claude mcp add --transport http claimhouse "https://aws-sandbox.myclaimhouse.com/api/mcp" \
  --header "Authorization: Bearer $CLAIMHOUSE_KEY"
```

**Cursor** (`.cursor/mcp.json`)

```jsonc
{
  "mcpServers": {
    "claimhouse": {
      "url": "https://aws-sandbox.myclaimhouse.com/api/mcp",
      "headers": { "Authorization": "Bearer ${env:CLAIMHOUSE_KEY}" }
    }
  }
}
```

**Claude Desktop** (`claude_desktop_config.json`, through the `mcp-remote` bridge, which connects a desktop client to a remote server)

```jsonc
{
  "mcpServers": {
    "claimhouse": {
      "command": "npx",
      "args": ["mcp-remote", "https://aws-sandbox.myclaimhouse.com/api/mcp", "--header", "Authorization:${AUTH_HEADER}"],
      "env": { "AUTH_HEADER": "Bearer ch_test_<key id>.<secret>" }
    }
  }
}
```

The header argument has no space in it (`Authorization:${AUTH_HEADER}`) and the key is in `env`: on Windows, Claude Desktop and Cursor pass an argument with spaces to the bridge unquoted, which breaks it.

**Any other client:** a streamable HTTP server at `https://aws-sandbox.myclaimhouse.com/api/mcp`, with the header `Authorization: Bearer <your key>`.

To list only the tools of the products your agent uses, add `?products=` to the address: see [Only the tools you need](#only-the-tools-you-need).

A test key only ever reaches the sandbox, so an agent cannot touch real patient data until you give it a live key. Live mode is not open yet, so every key is a test key today.

### Tools

There are 99 tools: one for each of the API's 96 endpoints, named after the endpoint's operation (`list_claims` is [`GET /claims`](https://aws-sandbox.myclaimhouse.com/docs/api/listClaims.md)), and curated tools that add judgement on top (5 in all). Where a curated tool does an endpoint's job it is that endpoint's only tool: `search_payers` is [`GET /payers/search`](https://aws-sandbox.myclaimhouse.com/docs/api/searchPayers.md) and `check_eligibility` is [`POST /eligibility`](https://aws-sandbox.myclaimhouse.com/docs/api/createEligibilityCheck.md). `tools/list` gives each tool's full description and input schema, and marks its permission (`_meta.permission`) and product.

The curated tools:

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `search_payers` | `read` | no | Find a dental payer by name, payer ID or alias, with what it supports. |
| `check_eligibility` | `submit` | optional | Run an eligibility check (a sandbox check with a test key); it can correct a rejected check with parent_id. |
| `explain_rejection` | `read` | no | Turn a rejection into its kind, reasons, the fields to change and suggested values. |
| `find_check` | `read` | no | Find checks you already ran, by the request ID of the call or your own reference. |
| `read_benefits` | `read` | no | Read the answer of a check: status, maximums, deductibles, coverage by category, per-procedure rows and what was not returned. |

The API's endpoints, by product, in the order an agent usually works through them:

#### Account

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_current_key` | `read` | no | Returns the API key making the request (its name, mode and permissions) and the organization it belongs to. |
| `get_rate_limits` | `read` | no | The rate limits of the key's organization as they apply to it now: for each bucket (the key, the organization, payer and registry calls, each office) the steady rate a second and the burst, and whether Claim House set the organization's own figures. |

#### Payers

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_payer` | `read` | no | One payer, by its Claim House ID (pyr_...), its payer ID or any alias. |
| `list_payers` | `read` | no | The payer directory, ordered by name, one page at a time. |

#### Offices

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `create_office` | `submit` | yes | Adds an office to the key's organization, in the key's mode: a test key adds a test office, to run sandbox checks for (a live office needs the organization to be live). |
| `create_practice_group` | `submit` | yes | Adds a practice group to the key's organization, in the key's mode: a name, and optionally your own client_reference. |
| `delete_practice_group` | `submit` | no | Deletes a group that holds no offices; one that still holds offices is 409 CONFLICT (move them out with PATCH /offices/{id} first). |
| `get_office` | `read` | no | One office of the key's organization and mode. |
| `get_practice_group` | `read` | no | One practice group of the key's organization and mode, with how many offices it holds. |
| `list_offices` | `read` | no | The offices of the key's organization, in the key's mode (test or live), by name, 50 a page by default. |
| `list_practice_groups` | `read` | no | The practice groups of the key's organization in the key's mode, by name, one page at a time, each with how many offices it holds. |
| `move_office_claims` | `submit` | yes | Moves the unsent claims and predeterminations of the office to another office of the same organization and mode (to_office_id): its drafts, the ones that need attention, the validated and the queued ones, and the rejected ones the payer never gave a number. |
| `register_office_attachments` | `submit` | yes | Registers the office with the attachment network, once: it needs its contact name and email, its primary doctor's name, and its address, phone and tax ID, each within the network's limits (doctor names 25, contact name 40, contact email 80, address 48, city 32 characters, a 10-digit phone); anything missing or too long is a 422 naming each field, and nothing is sent. |
| `update_office` | `submit` | yes | Changes an office: any field POST /offices takes, each checked by the same rule as there (an NPI's check digit, a billing address that is no PO box, a ZIP of 5 or 9 digits). |
| `update_practice_group` | `submit` | yes | Renames the group or changes its client_reference (null clears it); send at least one. |

#### NPI lookup

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `lookup_npi` | `read` | no | What the national NPI registry (NPPES) holds for an NPI: whether it is an organization or an individual, its status, name, primary practice address and phone, and primary taxonomy with the license listed for it. |

#### Providers

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `create_provider` | `submit` | yes | Adds a dentist who renders treatment, so a claim can name them as its rendering provider. |
| `get_provider` | `read` | no | One provider of the key's organization and mode. |
| `list_providers` | `read` | no | The providers of the key's organization in the key's mode (test or live), by last name, one page at a time. |
| `update_provider` | `submit` | yes | Changes the fields sent and leaves the rest. |

#### Enrollments

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `create_enrollment` | `submit` | yes | Starts tracking the enrollment of a provider, or of an office's billing NPI and tax ID, with a payer for claims, ERAs, or ERAs with EFT. |
| `get_enrollment` | `read` | no | One enrollment of the key's organization and mode. |
| `list_enrollments` | `read` | no | The enrollments of the key's organization in the key's mode, newest first, one page at a time. |
| `update_enrollment` | `submit` | yes | Changes the fields sent and leaves the rest: the status (only along the allowed changes: an open enrollment may move to another open status, to active or to denied, and an open one may also be withdrawn; paperwork submitted to the payer is never not started again; an active, denied or withdrawn one may only start over), the dates (null clears one) and the note. |
| `withdraw_enrollment` | `submit` | yes | An open enrollment becomes withdrawn: the office or provider no longer wants it. |

#### Patients

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_patient` | `read` | no | One patient with coverage as last verified, and their newest checks, claims (void transactions left out) and payments on any of their claims (up to 25 of each), by ID and state. |
| `list_patients` | `read` | no | The patients of your organization in the key's mode, newest first (by when Claim House first saw them), with coverage as last verified, open claims and open charges. |
| `search_patients` | `read` | no | Finds patients by the words of their name, their date of birth or a member ID on any of their checks or claims (all that are given must match), inside the list's filters, newest first. |

#### Eligibility

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `cancel_eligibility_batch` | `submit` | yes | Stops a running batch: the checks not yet run are skipped, a check already running finishes and is recorded. |
| `create_eligibility_batch` | `submit` | yes | Runs up to 200 eligibility checks together: each item of checks is a check request exactly as POST /eligibility takes it, and becomes an ordinary check (billed and reported as any other) once the batch runs. |
| `get_eligibility_batch` | `read` | no | One batch of the key's organization and mode: its state and counts, and each item in order with the check it made (read it with GET /eligibility/{id}) or why it failed or was skipped. |
| `get_eligibility_check` | `read` | no | One check of the key's organization and mode, with the request it was made from and the answer or rejection. |
| `get_eligibility_check_x12` | `read` | no | The exchange of a check as text, one segment per line: the 270 request Claim House sent to the payer network and the 271 response it returned. |
| `list_eligibility_batches` | `read` | no | The batches of the key's organization in the key's mode, newest first, as summaries (with counts, without the items; read one batch for those). |
| `list_eligibility_checks` | `read` | no | The checks of the key's organization in the key's mode, newest first, as summaries (without the request and the benefits; read one check for those). |

#### Claims

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `cancel_claim_correction` | `submit` | yes | For a claim opened for a correction (resubmit of a claim the payer accepted, paid or denied) and not yet sent again (needs attention, validated or queued): the claim gets back the content, lines, attachments, frequency and snapshot it had before the correction (what the payer has: edits made since are undone; an attachment that cannot be put back is named on the timeline) and the state its payments derive (paid or denied as its payment stands, else accepted_payer); a timeline entry and claim.status_updated. |
| `convert_claim` | `submit` | yes | For a predetermination whose estimate came back (state returned): makes a new claim (kind claim, a draft) with the same patient, subscriber, payer, office, provider and lines, awaiting its service dates, linked both ways (converted_from, converted_to). |
| `create_claim` | `submit` | yes | Makes a dental claim from JSON. |
| `create_next_claim` | `submit` | yes | For a claim its payer paid or denied, whose ERA was applied: makes a new claim for the payer that comes next (a secondary from a primary, a tertiary from a secondary). |
| `get_claim` | `read` | no | One claim of the key's organization and mode, with its lines, the result of its last validation, its network references, the rejection in plain words when it was rejected, next_step, and once it is queued its snapshot: what its file says of the billing office, service location and rendering provider, which a later edit of the office or provider does not change. |
| `get_claim_timeline` | `read` | no | What happened to the claim, oldest first, in plain words: created, validated, queued, submitted (with the file and the claim's place in it), the 997 and 277 statuses, rejections, corrections and voids. |
| `get_claim_x12` | `read` | no | The claim as it was sent, as text: the envelope of the file it travelled in, the levels above the claim and the claim's own segments, one per line. |
| `list_claims` | `read` | no | The claims of the key's organization in the key's mode, newest first, as summaries (read one claim for its lines, findings and network references). |
| `reconcile_claim` | `submit` | yes | Says you posted the claim's payment in your system: a paid or denied claim becomes reconciled (a reconciled one is returned as it is). |
| `resubmit_claim` | `submit` | yes | For a claim that was rejected or needs attention, or that the payer accepted, paid or denied (to correct it): applies the corrections in the body (only the fields to change, as for an update; an empty object for none), validates the claim and queues it, under the same claim ID, with a new snapshot of its office and provider as they are now. |
| `submit_claim` | `submit` | yes | Validates a draft or a claim that needs attention and queues it when it has no errors (a claim with errors comes back as needs_attention with its findings; one identical to a claim already queued or sent comes back with a DUPLICATE_CLAIM error unless either carries allow_duplicate). |
| `update_claim` | `submit` | yes | Changes the fields sent and keeps the rest, while the claim is a draft, needs attention, or was rejected (correct a rejected claim, then resubmit it). |
| `validate_claim` | `submit` | yes | Checks a claim body the way creating it would and stores nothing: every finding together, errors (which keep a claim from being sent) and warnings. |
| `void_claim` | `submit` | yes | A claim the payer has not seen (a draft, validated, needing attention, queued, or rejected without a payer claim number) becomes voided at once. |

#### Attachments

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `close_attachment` | `submit` | yes | Sends the attachment to the attachment network and closes it: it needs a document or a narrative, its office is registered with the network first when it is not, and its payer must take attachments. |
| `create_attachment` | `submit` | yes | Makes an open attachment: for a claim (its office, payer and patient are taken from it), for a payer request (kind solicited: its claim and payer, and the payer's reference number), or on its own (an office and a payer that takes attachments). |
| `delete_attachment_document` | `submit` | no | Removes a document and its image while the attachment is open and not yet being sent (closing sends it). |
| `discard_attachment` | `submit` | no | Deletes an open attachment you no longer want (the wrong office or patient, or a payer that stopped taking attachments), with its documents and their images. |
| `get_attachment` | `read` | no | One attachment of the key's organization and mode, with its documents, and once closed its number and what a claim file carries for it. |
| `get_attachment_document_url` | `read` | no | A link that shows one page of the document's image for 60 seconds (page, from 1: the first by default; a page the document does not have is not found; the answer says the page and the document's pages): ask for a new one each time it is shown. |
| `list_attachment_document_types` | `read` | no | The document types an attachment's documents can be. |
| `list_attachments` | `read` | no | The attachments of the key's organization in the key's mode, newest first, each with its documents. |
| `update_attachment` | `submit` | yes | Changes an open attachment not yet being sent: its narrative, and, for one made for no claim or for a claim that was voided, its patient, subscriber and service_dates (the network's record needs them; send the fields to change). |
| `upload_attachment_document` | `submit` | yes | Adds a document to an open attachment, as multipart/form-data: the JPEG, PNG or PDF in the field "file", and its document type (and, for an X-ray or a photo, its date and orientation). |

#### Payer requests

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `answer_payer_request` | `submit` | yes | Answers with a solicited attachment that carries the payer's reference number: the one named, else the request's open one (make it with POST /attachments, kind solicited, and upload its documents first), else a new one with the narrative given (for a request about no claim, with office_id and the patient, subscriber and service_dates, which the network's record needs). |
| `create_payer_request` | `submit` | yes | Records a request that came by letter or phone, about a claim (its payer) or with a payer of its own. |
| `get_payer_request` | `read` | no | One payer request of the key's organization and mode. |
| `list_payer_requests` | `read` | no | The payer requests of the key's organization in the key's mode, newest first: what payers asked for about claims they have. |

#### ERAs

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_era` | `read` | no | One remittance as JSON: the payment (method, trace number, date, total), whether it adds up, and every claim payment with its lines, each matched to its claim or shown unmatched (with the patient's name as the payer wrote it, to match it by hand). |
| `get_era_x12` | `read` | no | The remittance as the payer sent it, as text: your organization's remittance only, as an interchange of its own (a file shared with others is never shown), one segment per line. |
| `list_eras` | `read` | no | The remittances (835) the payers sent to your organization in the key's mode, newest first, as summaries (read one for its claims and lines). |
| `match_era_claim` | `submit` | yes | Matches an unmatched payment of the ERA to one of your claims (sent, in the key's mode, and able to take a payment now: not while it is being corrected, rejected or voided) by hand, and applies it: the claim's figures become the sum of its payments, and it is paid or denied. |
| `post_era` | `submit` | yes | Says you posted the ERA in your system: every claim it paid or denied (and that no later remittance changed) becomes reconciled, and the ERA posted. |

#### Events

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_event` | `read` | no | One event of the key's organization and mode. |
| `list_events` | `read` | no | The events of the key's organization in the key's mode, newest first. |
| `replay_event` | `submit` | yes | Sends the event again: one new delivery is queued for each endpoint that is enabled and subscribed to its type now (none when there is no such endpoint). |

#### Webhook endpoints

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `create_webhook_endpoint` | `submit` | yes | Registers a URL to send events to. |
| `delete_webhook_endpoint` | `submit` | no | Removes the endpoint and its deliveries: nothing more is sent to it. |
| `disable_webhook_endpoint` | `submit` | yes | Stops sending events to the endpoint. |
| `enable_webhook_endpoint` | `submit` | yes | Starts sending events to the endpoint again. |
| `get_webhook_endpoint` | `read` | no | One webhook endpoint of the key's organization and mode, without its signing secret. |
| `list_webhook_endpoints` | `read` | no | The webhook endpoints of the key's organization in the key's mode, newest first. |
| `rotate_webhook_secret` | `submit` | yes | Replaces the endpoint's signing secret: events are signed with the new secret from now on, and the old one stops working at once. |

#### SFTP account

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `add_sftp_key` | `submit` | yes | Adds a public key that may log in, under a label. |
| `disable_sftp_account` | `submit` | yes | Refuses every new login at once, with the password or a key. |
| `enable_sftp_account` | `submit` | yes | Allows logins again. |
| `get_sftp_account` | `read` | no | The organization's SFTP account: its status, the host, port and host key fingerprint to connect to, the four folders, the keys that may log in, and when it last logged in and last had a file taken. |
| `list_sftp_files` | `read` | no | The files taken from the account's IN and TEST/IN folders, newest first, one page at a time, each with what became of it: how many claims it made and how many it refused, and the names of the 997, 277 and report written for it. |
| `remove_sftp_key` | `submit` | no | Removes the key: it can no longer log in. |
| `rotate_sftp_password` | `submit` | yes | Replaces the account's password with a new generated one: the old one stops working for every new login at once. |
| `set_up_sftp_account` | `submit` | yes | Makes the organization's SFTP account: a user name chosen from the organization's name and a generated password. |

#### Reports

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_report_summary` | `read` | no | Where money and time went in a period, for the key's organization in the key's mode: billed, paid, first-pass acceptance, median days to pay and the claims unpaid over 30 days; days to payment by payer, rejections by reason, acceptance by office and adjustments by reason. |

#### Usage and statements

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `get_statement` | `read` | no | One statement with its lines: the products with their counts, reasons, rates and amounts, the fees, the minimum, the monthly and setup fees and the amount due, as they were when the month was closed. |
| `get_usage` | `read` | no | The usage of the key's organization in a billing month, in the key's mode: for each product the billable transactions and those not billed (with the reason for each kind), the rate and the amount (for a product charged per location, the locations counted); for eligibility each tier's checks and price; the fees, the monthly minimum, the monthly and setup fees of your agreement, and the amount due (the greater of the fees and the minimum, plus those fees and adjustments). |
| `list_statement_offices` | `read` | no | A statement's usage by office, as stored when the month was closed (office and practice group names included), never changing after. |
| `list_statements` | `read` | no | The monthly statements of the key's organization, newest first. |
| `list_usage_by_office` | `read` | no | The usage of a billing month by office, in the key's mode. |
| `list_usage_units` | `read` | no | The usage records of a billing month in the key's mode, oldest first: one for each check, claim, attachment or ERA, with whether it is billable and why, and for a billable record of a billed month its price under the month's rates (at volume rates, the rate of its place in the month). |

#### Sandbox

| Tool | Needs | idempotency_key | What it does |
| --- | --- | --- | --- |
| `list_sandbox_scenarios` | `read` | no | The scripted payer scenarios a test key can trigger. |

### Only the tools you need

`tools/list` is about 218 KB of descriptions and schemas for all 99 tools. Some clients keep only so many tools active at once (Cursor about 40) or send every tool's description with each prompt, so connect with only the products your agent uses: add `?products=` to the server's address with one or more products, separated by commas. Each product brings the products its tools need (a check needs a payer and an office), and `account` is always listed.

An agent that only checks eligibility connects to `https://aws-sandbox.myclaimhouse.com/api/mcp?products=eligibility` and gets 27 tools, about 48 KB:

```bash
claude mcp add --transport http claimhouse "https://aws-sandbox.myclaimhouse.com/api/mcp?products=eligibility" \
  --header "Authorization: Bearer $CLAIMHOUSE_KEY"
```

In Cursor or any other client, put the same address in `url`. A claims agent might use `?products=claims,patients,attachments,eras`.

| products= | Product | Also lists | Tools | tools/list |
| --- | --- | --- | --- | --- |
| `account` | Account | (nothing) | 2 | 1 KB |
| `payers` | Payers | `account` | 5 | 5 KB |
| `offices` | Offices | `account` | 13 | 26 KB |
| `npi` | NPI lookup | `account` | 3 | 2 KB |
| `providers` | Providers | `account`, `npi` | 7 | 13 KB |
| `enrollments` | Enrollments | `account`, `payers`, `npi`, `providers` | 15 | 26 KB |
| `patients` | Patients | `account` | 5 | 6 KB |
| `eligibility` | Eligibility | `account`, `payers`, `offices` | 27 | 48 KB |
| `claims` | Claims | `account`, `payers`, `offices`, `npi`, `providers` | 35 | 122 KB |
| `attachments` | Attachments | `account`, `payers`, `offices`, `npi`, `providers`, `claims` | 45 | 139 KB |
| `payer_requests` | Payer requests | `account`, `payers`, `offices`, `npi`, `providers`, `claims`, `attachments` | 49 | 146 KB |
| `eras` | ERAs | `account`, `payers`, `offices`, `npi`, `providers`, `claims` | 40 | 129 KB |
| `events` | Events | `account` | 5 | 5 KB |
| `webhooks` | Webhook endpoints | `account`, `events` | 12 | 13 KB |
| `sftp` | SFTP account | `account` | 10 | 11 KB |
| `reports` | Reports | `account` | 3 | 3 KB |
| `usage` | Usage and statements | `account` | 8 | 10 KB |
| `sandbox` | Sandbox | `account` | 3 | 2 KB |

Without `products` the server lists every tool. A name that is not a product is refused when the client connects, with the product it most likely means; a tool of a product the connection leaves out is refused with the product to add. The server's instructions (what `initialize` tells the agent) name only the connection's tools.

### Arguments and answers

- A tool takes the endpoint's path parameters, query parameters and body fields as one object of arguments, with the same names and descriptions as the API reference. An argument the tool does not know is refused with `INVALID_REQUEST` and the issue code `unknown_field`.
- A tool answers with the object the API returns, as JSON text and as structured content; a list has `data` and `next_cursor`, and you page with `cursor` and `limit` as in the API. A file the API returns as text (a claim's 837D, an ERA's 835) comes back as text.
- When the API would answer with an error, the tool answers with `isError` set and the API's error body (`error`, `message`, `errors`), so the agent can read it and fix the request. A rejected check carries the check, as it does in the API.
- A tool whose `idempotency_key` column says yes (a write the API makes with a POST or a PATCH) needs that argument; one that says optional (an eligibility check, which only asks) takes it when you send it and simply runs without it; the others take none (a read, a delete, a search sent as a POST). It plays the part of the `Idempotency-Key` header: a call repeated with the same key and the same arguments gets the first answer and never runs twice, and the same key with other arguments is refused with `IDEMPOTENCY_KEY_REUSED`. To resend a rejected check with fixes, send it again with `parent_id` set to the rejected check (and a new `idempotency_key` if you send one).
- `upload_attachment_document` takes the file as `content_base64` (the JPEG, PNG or PDF file in base64) with its `media_type`, instead of a multipart form. The same limits and checks apply: a file up to 15 MB, refused by its size before it is decoded.
- An eligibility check through MCP never skips a saved answer: an identical check within 60 minutes is answered from the saved one. The API's `Cache-Control: no-cache` header has no tool argument; use the API to ask the payer again.

### How it works

- Every request is a `POST` of one JSON-RPC message to `https://aws-sandbox.myclaimhouse.com/api/mcp`. It answers with JSON in the same response: there is no session and no event stream, and `GET` and `DELETE` answer `405`.
- The server speaks these versions of the MCP specification: `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`. It answers `initialize` with the version the client asks for when it speaks it, and otherwise with the newest.
- The key must have `read` permission for any request (so any key can list the tools), and each tool needs the permission its table says. A key without it gets `PERMISSION_DENIED`, and nothing runs.
- Every answer is `application/json`, whatever the `Accept` header says (a client that asks only for `text/event-stream` gets JSON too). A message may nest at most 32 levels deep.
- A request from a web page whose `Origin` is not this site's own is refused with `403`. MCP clients that are not browsers send no `Origin` and are not affected.
- Requests are logged like API requests, on the dashboard's request log (Developers, then Request log), under the path `/api/mcp#<tool>`. The log never holds the arguments.
- The limits of the API apply: a request body up to 1 MB (a key with `submit` may send one as large as an upload in base64), and 45 seconds to answer.

You can try it with `curl`: this lists the tools.

```bash runnable status=200
curl "https://aws-sandbox.myclaimhouse.com/api/mcp" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

### Try asking

> Find a payer called Delta, then check coverage for Sam Sample, born 1990-01-01, member ID CH-ACTIVE-FULL, at my test office for a D2740 crown. Tell me the remaining annual maximum and what the plan pays for the crown. Then try CH-NOT-FOUND and explain what to change.

> Send a claim for that crown with my test office and its first provider, attach a bitewing X-ray, and tell me when the payer has answered and what it paid.

Give the agent made-up people only.

## Machine-readable docs

| Resource | What it is | Address |
| --- | --- | --- |
| OpenAPI 3.1 document | Every endpoint, field and error code, generated from the same definitions the API checks requests with, so it matches the API exactly. Agents and code generators read this. | `https://aws-sandbox.myclaimhouse.com/docs/openapi.json` |
| `llms.txt` | An index of every docs page, one line each, with its description. | `https://aws-sandbox.myclaimhouse.com/docs/llms.txt` |
| `llms-full.txt` | Every docs page as markdown, in one file, for a model's context. | `https://aws-sandbox.myclaimhouse.com/docs/llms-full.txt` |
| Markdown pages | Add `.md` to the address of any docs page to get the page without navigation or styling. | `https://aws-sandbox.myclaimhouse.com/docs/quickstart.md` |

The reference pages are generated from the API's own definitions, so a field list on a reference page and in the OpenAPI document are the same thing. The guides are written by hand and their `curl` examples are run against the sandbox by the tests.

## Prompting tips

- **Give it the spec.** Paste the `openapi.json` address, or `llms-full.txt`, so the agent uses real field names instead of guessing. Every field is `snake_case`.
- **Start in the sandbox.** Ask the agent to use a test key and the scripted member IDs: `CH-ACTIVE-FULL` for an answer, `CH-NOT-FOUND` for a rejection it can fix, `CH-PAYER-DOWN` for a payer that is down. See [Sandbox and scenarios](https://aws-sandbox.myclaimhouse.com/docs/sandbox.md).
- **Handle every outcome.** Tell it to branch on the check's `outcome`, and on `rejection.kind`: `fix_and_resend`, `payer_unavailable` or `rejected`.
- **Make requests safe to repeat.** Tell it to send a new `Idempotency-Key` for each new attempt, and to reuse a key only to repeat a request that got no answer. See [Errors, retries and idempotency](https://aws-sandbox.myclaimhouse.com/docs/errors-and-idempotency.md).
- **Keep patient data out of prompts and logs.** Use made-up people. Never give an agent a live key unless you mean it to touch real patients.

A prompt that works well:

```text
Using the Claim House API described at https://aws-sandbox.myclaimhouse.com/docs/openapi.json, write a function that runs an
eligibility check with a test key, returns the plan's remaining annual maximum, and, when the payer
rejects the check with kind fix_and_resend, resends it once with the corrected value and parent_id.
Use the sandbox member IDs CH-NOT-FOUND and CH-ACTIVE-FULL to test both paths.
```
