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.
Privacy: read this first
Section titled “Privacy: read this first”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.
Set-up
Section titled “Set-up”- 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.
- Build the package from the TravStats repository (
packages/travstats-mcp, Node 20 or newer):npm ci && npm run build. - 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" } } }}| Variable | Meaning |
|---|---|
TRAVSTATS_URL | Base address of your instance (required) |
TRAVSTATS_TOKEN or TRAVSTATS_TOKEN_FILE | The 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_DIR | The one folder the file tools may read. Without it, file tools are not offered |
TRAVSTATS_MCP_AUDIT_FILE | Off by default. A path: one JSON line per tool call |
TRAVSTATS_ALLOW_INSECURE_HTTP | 1 allows plain http to a public address; private and local addresses may use http without it |
TRAVSTATS_MCP_CALLS_PER_MINUTE | Client-side call budget, default 60 |
Scopes
Section titled “Scopes”| Token scope | Result |
|---|---|
read | The read tools. Write tools are not offered. |
write | Read and write tools. |
admin | Refused at start-up. |
Read tools
Section titled “Read tools”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 saystruncated: truewhen 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.
Write tools (scope write)
Section titled “Write tools (scope write)”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_bookingreads pasted text (up to 20 kB) or a PDF, image or.emlfrom the files folder and returns a draft. - Adding needs
confirm: true.add_entry_from_draftandadd_flightfirst return what they would send. Only withconfirm: truedo they upload the original document and create the entry carrying it. upload_documentputs a file into your inbox as an unassigned document, or links it to an entry you name.resolve_inbox_itemanswers one inbox item with that kind’s own actions.reroute_trip_legsstarts 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.