Skip to content

MCP server for AI assistants

travstats-mcp is a local MCP server for your own TravStats instance. An assistant such as Claude Desktop or Claude Code can look up your trips, statistics and open inbox items. With a write key it can also read a booking confirmation and add the entry. It talks to the normal REST API with an API key, so it can do nothing that key could not.

Everything a tool returns is sent to the AI provider your client talks to and is stored under that provider’s terms. TravStats cannot take it back. The read tools return summaries only — no documents, photos or passport data — but trip names, places and dates are still personal.

The write tools send booking text, PDFs and photos to your server, and the server may read them with its own AI parser (a service you set up there; it can cost money and may leave the server).

Nothing is collected by the package. It only calls the server you configure.

  1. Under Einstellungen → Mein Konto → Profil & Anmeldung → API-Schlüssel (expert view) create a key with scope read. Create a write key only if you want the write tools. An admin key is refused at start-up.
  2. Build the package from the TravStats repository (packages/travstats-mcp, Node 20 or newer): npm ci && npm run build.
  3. Add it to your client. For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"travstats": {
"command": "node",
"args": ["/path/to/travstats-mcp/dist/index.js"],
"env": {
"TRAVSTATS_URL": "https://travstats.example.org",
"TRAVSTATS_TOKEN_FILE": "/home/me/.config/travstats-mcp/token"
}
}
}
}
VariableMeaning
TRAVSTATS_URLBase address of your instance (required)
TRAVSTATS_TOKEN or TRAVSTATS_TOKEN_FILEThe ts_pat_… key, or a file holding it. Prefer the file: an env entry sits in plain text in the client’s config
TRAVSTATS_MCP_FILES_DIRThe one folder the file tools may read. Without it, file tools are not offered
TRAVSTATS_MCP_AUDIT_FILEOff by default. A path: one JSON line per tool call
TRAVSTATS_ALLOW_INSECURE_HTTP1 allows plain http to a public address; private and local addresses may use http without it
TRAVSTATS_MCP_CALLS_PER_MINUTEClient-side call budget, default 60
Token scopeResult
readThe read tools. Write tools are not offered.
writeRead and write tools.
adminRefused at start-up.

search_entries, list_trips, get_trip_summary, get_stats, get_upcoming, get_travtrack_day, list_inbox, get_readiness, get_routing_run. Resources: travstats://trip/{id} and travstats://year/{yyyy}.

  • Lists page with a cursor; every result is capped at about 20 kB and says truncated: true when it was cut.
  • A value the server cannot derive stays null; it is never turned into zero.
  • Every failure has its own reason: unreachable, auth, scope, not_found, rate_limited, disabled, timeout, server. An empty list means empty.
  • The token is redacted from every output and log line; redirects are not followed.

parse_flight_text, parse_boarding_pass, parse_booking, add_flight, add_entry_from_draft, add_place_visit, resolve_inbox_item, reroute_trip_legs, upload_document.

  • Parsing saves nothing. parse_booking reads pasted text (up to 20 kB) or a PDF, image or .eml from the files folder and returns a draft.
  • Adding needs confirm: true. add_entry_from_draft and add_flight first return what they would send. Only with confirm: true do they upload the original document and create the entry carrying it.
  • upload_document puts a file into your inbox as an unassigned document, or links it to an entry you name.
  • resolve_inbox_item answers one inbox item with that kind’s own actions. reroute_trip_legs starts the server’s re-route job.
  • Never offered: deletes, merges, sharing, settings, tokens, admin.

Files come only from the one configured folder, never from a tool argument. .., a symlink out of the folder and anything that is not a regular file are refused. The file type is read from the content, not the name. Text a tool returns (e-mail bodies, notes) is marked untrusted: it is data, never instructions.

A write made through the package shows in the change history as “via MCP / ”.

See Personal access tokens for scopes.