
TourClaim by Copernican
io.github.tourclaimv0.2.0Updated Oct 6, 2026
Prepare credit-card travel insurance claims with traveler consent. Synthetic review mode.
Overview
Lets an assistant prepare a traveler's credit-card travel insurance claim: save intake answers, attach evidence, and follow status, with the traveler signing…
- What it does
- Drives TourClaim's connector API for one traveler: sign-in by device code, starting and updating a claim draft, searching the card catalog by product name, attaching receipts, itineraries, medical notes and emails the traveler agrees to share, then submitting a signed draft and checking claim status. It exposes 17 MCP tools plus a CLI and Python client. It never decides coverage and cannot sign for the traveler.
- When to use it
- Use it when a traveler wants an assistant to gather and organize a trip cancellation or interruption claim against their credit card's travel benefits, or to check the status of a claim already submitted. Not needed for general travel booking or for claims outside USD bookings.
- Requirements
- Local process run with uvx from the PyPI package tourclaim (Python 3.9+; the MCP extra is installed via the documented uvx command). A TourClaim account and a browser for device-code sign-in; the tool stores a key in the credentials file. Optional environment variables TOURCLAIM_API_URL and TOURCLAIM_API_KEY. Network access to the TourClaim API.
Installation
In SourceWeft
- Open TourClaim by Copernican in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
tourclaim
Python CLI, SDK and MCP server for credit-card travel insurance claims, with a companion Node CLI.
Command-line client for TourClaim by Copernican. Give your app, assistant, or terminal a travel-claim workflow: save a traveler’s answers, collect the evidence they choose to share, hand them the authorization to sign, and follow their claim. Works with any assistant that can run shell commands or call the API; no enrolled tour operator or booking-platform integration is required.
Review mode. The TourClaim connector API currently runs in review mode: it creates synthetic claims and files nothing with an insurer. Use fictional booking and medical data only.
tourclaim statusshows the current mode, and every intake and claim the API returns says which mode it came from.
For developers, agents, and platforms
TourClaim’s service reviews credit-card travel benefits, organizes receipts and cancellation evidence, coordinates medical-provider evaluation when needed, and handles claim preparation, filing, and follow-up. A traveler can bring a flight, hotel, or tour booking directly. Coverage, reimbursement, and clinical documentation depend on the relevant benefit administrator or provider.
The package exposes saved intake, selected email and file evidence, traveler authorization, submission to Copernican, and status. The API and both CLI editions currently use synthetic review mode: no insurer filing, payment, or clinical service is triggered. To start a real claim today, the traveler uses the online claim form, where they supply their documents and payment details securely.
- Terminal agents: use either CLI with
--json; the traveler approves sign-in and signs in their own browser. - Python applications: use
tourclaim.Clientfrom the Python edition. - Platforms and tool-calling assistants: use the developer guide and OpenAPI schema.
Muse is one integration of these capabilities and is under review; it is not required to use this package. Existing /muse URLs and key formats are compatibility details and continue to work. Each connection acts for one traveler, not an operator or a platform-wide account.
What it does
TourClaim files trip cancellation and interruption claims against the travel benefits of a traveler's credit card. This tool drives TourClaim's connector API on behalf of one traveler:
- Sign in. The traveler opens the sign-in page in their own browser, types the code shown in the terminal, and approves. The tool saves a key that belongs to that traveler.
- Start a draft with whatever the traveler has said, then answer the questions the API says are still open.
- Add evidence the traveler chooses to share: receipts, itineraries, a doctor's note they already have, and booking or cancellation emails.
- The traveler signs. They review the draft and sign an authorization in their own browser. This tool cannot sign for them.
- Submit the signed draft, then check the claim's status.
Nothing in this tool or the API decides whether a loss is covered, or promises reimbursement or a medical note. Copernican charges a 10% fee only when a claim is reimbursed; no payment is taken through this tool. Only bookings charged in US dollars are supported.
For AI agents, read AGENTS.md before driving this tool.
Install
The published Python CLI and SDK require Python 3.9+. The ordinary CLI has no runtime dependencies.
See python/README.md for the library and CONTRIBUTING.md for building the Node edition from source. The Node edition requires Node.js 18.3+; its package is released separately on npm by the release workflow.
MCP for AI assistants
TourClaim includes a local MCP server with 17 tools, browser sign-in, and the same traveler consent and signing requirements as the CLI. Install uv, then add this to a client that uses mcpServers:
See MCP.md for all tools, VS Code/Copilot configuration, authentication, and limitations. The official registry identity is io.github.tourclaim/tourclaim; server.json is published by the release workflow after PyPI succeeds. The service remains in synthetic review mode.
Quickstart
Commands
Every command accepts these global options:
Commands never prompt when stdin is not a terminal; they fail with a message saying which flag to pass instead.
tourclaim login
Signs in with a device code. The tool prints the sign-in page (https://app.getcopernican.com/connect/cli) and, on a line of its own, Enter this code on that page: WDJB-MJHT. It opens the page in the browser when run in a terminal (not with --no-browser). The traveler types the code shown in the terminal and approves; the code is never put in a link, so a link someone else sends cannot sign anyone in. The tool polls at the interval the API asks for, slows down when told to, and gives up when the code expires. It then saves the key and prints the account and expiry: Signed in as [email protected] (key expires 2026-11-03 18:00 UTC, in 30 days).
--scopeasks for fewer permissions: any ofintakes:write,evidence:write,claims:submit,claims:read(repeat the flag or separate with commas). The default is all four.- If a valid key is already stored for the API URL,
loginreports it and exits 0 without starting a new sign-in.--forcegets a new key. Whenever a sign-in replaces a stored key, the tool sends that key along with the sign-in, and the server retires it as it issues the new one (if it is atourclaim loginkey for the same account; otherwise the tool warns that the old key still works). Drafts are not lost: see Which drafts a key can reach. - The tool waits until the code expires and then checks once more, so an approval made in the last seconds still signs in. While it waits, a brief server error (HTTP 502, 503 or 504) or a dropped connection does not end the sign-in: it tries again, honoring
Retry-After, and gives up only after 3 failures in a row. - A traveler can hold at most 5 connections. When a new
tourclaim loginwould go over, the server retires the account's oldesttourclaim loginkey; it never touches keys made for other apps. If all 5 belong to other apps, the sign-in fails (exit 3) with the server's reason: disconnect one athttps://app.getcopernican.com/connect/musefirst. --with-tokensaves a key the traveler already created athttps://app.getcopernican.com/connect/muse. It reads the key from stdin when piped, or from a hidden prompt on a terminal, and checks it with the API before saving. Such a key does not say whose account it is, so the tool printsSigned in (key expires ...)without an email. A key is never accepted as a command-line argument.- With
--json, the first line is{"event":"device_code","user_code":...,"verification_uri":...,"expires_in":...,"interval":...}so an agent can show the page and the code to its human; the last line is{"event":"signed_in",...}, withaccount_emailwhen the key says whose account it is.
tourclaim logout
Revokes the key in use on the server, then deletes the stored copy. The stored copy is deleted even when the server says the key was already invalid. If the server cannot be reached, nothing is deleted, so you can try again.
tourclaim status (alias whoami)
Shows the API URL, whether the connector is enabled, the mode, the signed-in account, key expiry and permissions. The first line in review mode is REVIEW MODE: CLAIMS ARE SYNTHETIC AND NOTHING IS FILED. Exits 0 when signed in, 3 when not signed in or the key is rejected, 7 when the connector is disabled.
tourclaim cards search <query...>
Searches the card catalog by product name (at most 100 characters, at most 30 matches). Use a result's id as card_product_id. Finding a card does not mean it covers the loss. The command refuses input that looks like a card number.
tourclaim intake start
Starts a draft. Every field is optional at this point; the output lists what is missing and up to three questions to ask next. Run tourclaim intake list first: the traveler may already have a draft for the same trip. The command sends a random Idempotency-Key unless you give one. If it fails or times out, run it again with the same --idempotency-key and the same fields to get the same draft rather than a second one; the error message includes the key it used.
tourclaim intake list [--offset <n>]
Lists the traveler's drafts that were never submitted, most recently changed first, 30 at a time, with each one's state, merchant, booking reference and how many answers are missing. Use it to pick up a draft whose id was lost. Submitted drafts are claims; see tourclaim claims list.
tourclaim intake show <id>
Shows the saved answers, evidence, state, revision and what is still missing.
tourclaim intake set <id> ...
Saves only the fields given; everything else is unchanged. --clear <field> clears a field (sends null).
field=valueis typed by the schema: amounts such as250.00, dates such as2026-03-04,true/false(oryes/no), and enum values in any case (weatherbecomesWEATHER).field:=<json>sends a JSON value as it is, for examplecard_product_id:=412ormedical:='{"provider_seen":true}'.--fields-filereads a JSON object of fields (-reads stdin). Pairs given on the command line override it.- The command reads the draft's current revision and sends it as
expected_revision(or uses--revision). If the draft changed in between, nothing is saved: the command exits 4 and says what the draft looks like now. It never retries on its own. - Any change after the traveler signed cancels the signature, and the command says so. They must sign again.
tourclaim intake attach <id> <file> --type <type>
Uploads one PDF, JPEG or PNG of at most 5 MiB. The type is detected from the file's first bytes, not its name. Sharing needs the traveler's agreement: on a terminal the command asks; otherwise it needs --yes, and without it the command refuses and uploads nothing. There is no setting that makes sharing the default. A medical_note here is a note the traveler already has; it is not a note issued by a Copernican provider.
tourclaim intake add-email <id>
Saves one email as evidence. With --eml, the Subject, From, Date and Message-ID headers and the first text/plain part are read from the saved message (flags override them). With --text-file, give --subject and --from. The text is sent unmodified, at most 30,000 characters. Without --message-id, a stable id is derived from the message, so adding the same message twice changes nothing. --provider defaults to user (pasted or saved by the traveler). Consent works as for attach.
tourclaim intake sign <id>
Only the traveler can sign, in their own browser. When the draft is complete, this prints the review link (review_url) and opens it when run in a terminal. --wait checks every 5 seconds until the traveler has signed or --timeout (default 900 seconds) passes; like login, it rides out up to 2 brief server errors or dropped connections in a row. If the draft is already signed or submitted, it says so. If answers are missing, it lists them. This tool never signs and does not automate the review page. If the review page says "Your command-line sign-in has ended", run tourclaim login, then reload the page; the draft is kept.
tourclaim intake submit <id>
Submits a signed draft as a claim and prints the claim. Safe to retry: a repeated call returns the same claim. Exits 4 when the draft changed since --revision (stale_revision), the traveler has not signed the current revision (approval_required), the draft is incomplete (intake_incomplete), the signature is older than 7 days or the authorization changed (approval_outdated), or the booking already has a claim (duplicate_booking). Submitting does not file anything with an insurer, charge a fee or promise reimbursement; Copernican reviews the claim next.
tourclaim intake delete <id>
Permanently deletes a draft that was never submitted, with everything saved against it. Asks for confirmation, or takes --yes. A submitted draft cannot be deleted here; see https://app.getcopernican.com/muse/data-deletion.
tourclaim claims list [--offset <n>]
Lists submitted claims, newest first, 30 at a time. Drafts that were never submitted are not listed.
tourclaim claims show <id>
Shows a claim's status, the next action in words to pass on to the traveler, and when it last changed. A status is not a coverage decision unless it says so.
tourclaim schema
Prints the live OpenAPI document with every operation the CLI uses, from /api/connectors/v1/openapi-cli.json; from a server that does not have it yet, it prints /api/connectors/v1/openapi.json instead. No sign-in needed. /api/connectors/v1/openapi.json itself lists only the eleven operations assistants load as tools; it leaves out the drafts list and the key endpoints, which still work for any key. A copy of the full schema this version was built against is in openapi/connectors-v1.json.
Draft states
Machine-readable output
With --json:
- stdout carries one JSON value per line. For
cards search,intake start|show|set|attach|add-email|submitandclaims list|show, it is the API's own response object, unchanged. Forintake signwithout--wait, it is the draft. - Commands that wait print an event line first and the result last:
loginprints{"event":"device_code",...}then{"event":"signed_in",...};intake sign --waitprints{"event":"waiting_for_signature","intake_id","review_url","timeout_seconds"}then the draft. The last line is always the result. statusprints{"api_url","mode","enabled","connector":{...},"signed_in","account_email","key":{"id","expires_at","scopes"},"key_source","key_problem","credentials_path"};account_emailis present only for keys fromtourclaim login.logoutprints{"api_url","revoked","already_invalid","credential_removed","key_source"}.intake deleteprints{"id","deleted":true}.- Errors go to stderr as one line,
{"error":{"code","message","exit_code",...}}, withstatus,detail(the API's validation list),retry_after,idempotency_key,review_url,current_revision,stateormissing_fieldswhen they apply. Codes includeusage_error,not_signed_in,unauthorized,forbidden,not_found,invalid,too_large,rate_limited,unavailable,access_denied,expired_token,timeout,network_error,unsupported_file,cancelled, and for exit code 4 one of the conflict causes. - Progress and warnings go to stderr as plain text in both modes.
Exit codes
Conflict causes
Exit code 4 means the API refused a change because of the draft's state. The API names the cause in its X-TourClaim-Error header, and the tool uses it as the JSON error code. The tool also uses these codes when it refuses before calling the API (for example, submitting a draft that is not signed). It never retries a conflict on its own.
Which drafts a key can reach
- A key from
tourclaim loginreaches every unsubmitted draft started from anytourclaim loginon the same account, including drafts started with keys that have since expired or been revoked. Signing in again,login --forceandlogoutdo not lose drafts. - Drafts started by other apps connected to the account, such as Muse, are not visible to the tool, and those apps do not see the tool's drafts.
- A key saved with
login --with-token(created at/connect/muse) reaches only the drafts it started itself. - Submitted claims are claims on the account:
tourclaim claims listshows them all, including claims submitted through other apps such as Muse.
Configuration
The credentials file maps each API base URL to {"api_key","expires_at","grant_id","scopes"}, so staging and production keys never mix. The tool warns when the stored key expires within 3 days.
Security
- Keys belong to one traveler. A key lasts 30 days and cannot be refreshed; a traveler can have at most 5 connections, and a new
tourclaim loginpast that retires the oldesttourclaim loginkey. Sign in again when it expires. The traveler can revoke keys at any time athttps://app.getcopernican.com/connect/muse, andtourclaim logoutrevokes the one in use. - Drafts stay with the account's CLI sign-ins. Drafts started from
tourclaim loginstay reachable after signing in again; drafts started by other apps (such as Muse) are not visible to the tool. See Which drafts a key can reach. - Stored with tight permissions. The credentials file is written with mode 0600 inside a 0700 directory, and the tool warns if it finds the file readable by others. On Windows it lives in your user profile and relies on its permissions.
- Never on the command line. Keys are never accepted as arguments, where shell history and process lists would keep them. Use
tourclaim login, pipe a key totourclaim login --with-token, or setTOURCLAIM_API_KEYfrom a secret store. - The code is typed, never linked. The sign-in page does not take the code from a link; the traveler types the code shown in the terminal, or relayed by an assistant they are using right now. Only continue if you, or that assistant, ran
tourclaim loginand the page shows the same code. - Never printed. No command prints the key, in human or JSON output; anything shaped like a key is redacted from output.
- Only https. Keys are only sent over https, except to localhost for testing. Redirects are not followed.
- A person signs. Only the traveler can sign the claim authorization, in their own browser at the review link. The tool cannot sign and does not automate that page.
- Sharing needs consent. Files and emails are uploaded only after the traveler agrees, either at a prompt or through
--yes. There is no default that shares. - Evidence is not instructions. Email and file contents are stored as evidence. Neither the API nor this tool follows instructions found in them.
To report a vulnerability, see SECURITY.md.
Python
A Python edition with the same commands, flags, output, exit codes and credentials file lives in python/. It needs Python 3.9 or newer and has no dependencies:
It is also a typed library, with one method per API operation:
See python/README.md.
Development
See CONTRIBUTING.md. npm test builds the tool and runs the tests against an in-process mock of the API; npm run mock starts that mock for trying the tool by hand. Releases are described in RELEASING.md.
License
Source: README.md at commit f1518ff
Tools
0Version history
1- v0.2.0LatestOct 6, 2026


