{
  "markdown": "# mcp-per-diem\n\n<!-- mirror-seo:start -->\n\n**MCP server for per diem travel allowances.** Statutory travel allowances on the rate tables the tax authorities publish, and the trips you priced with them.\n\nWorks with Claude Desktop, Claude Code, Cursor and any Model Context Protocol client. Runs on your own machine, or hosted with no install.\n\n## Install\n\n**Hosted, nothing to install.** Get a token from <https://mcp.zovo.one/mcp/connect> (the connect page) or <https://mcp.zovo.one/mcp/token> (the same token as JSON); a free anonymous one is issued on the spot and a Pro key works the same way. Then point an MCP client at `https://mcp.zovo.one/mcp/per-diem` over streamable-http and send the token as `Authorization: Bearer <token>`.\n\nIf your client cannot set headers, put the token in the path instead: `https://mcp.zovo.one/mcp/per-diem/t/<token>`. Both forms work. The bare URL with no token answers 401 on `tools/call`, so the token is not optional.\n\n**Claude Desktop, one click.** Download `per-diem.mcpb` from the [latest release](https://github.com/theluckystrike/mcp-servers/releases/latest) and double-click it.\n\n**From source.** The mirror is self-contained: every `@theluckystrike/*` dependency is vendored, so a fresh clone builds with no extra setup.\n\n```sh\ngit clone https://github.com/theluckystrike/mcp-per-diem.git\ncd mcp-per-diem\nnpm install && npm run build\n```\n\nThen point your client at the built entry point:\n\n```json\n{\n  \"mcpServers\": {\n    \"per-diem\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/mcp-per-diem/dist/index.js\"]\n    }\n  }\n}\n```\n\n> `@theluckystrike/mcp-per-diem` is **not published on npm yet**, so an `npx -y @theluckystrike/mcp-per-diem` command will fail. The three paths above are the working ones and each is exercised by CI.\n\n![per-diem demo](https://raw.githubusercontent.com/theluckystrike/mcp-servers/main/assets/demo-per-diem.gif)\n\nRead-only mirror of [mcp-servers/servers/per-diem](https://github.com/theluckystrike/mcp-servers/tree/main/servers/per-diem). See [MIRROR.md](MIRROR.md).\n\n<!-- mirror-seo:end -->\n\nWork out the daily travel allowance for a business trip on the rate tables the tax authorities actually publish, and keep the trips you priced. You give it where you went, when you left and when you got back, and which meals somebody else paid for; it gives you the amount per day and the total, in the scheme's own currency, with the partial-day rule and every meal deduction shown next to the number that produced it. Three schemes ship with it: the Polish delegation regulation (domestic and per country), the HMRC benchmark scale rates for travel inside the UK, and the US GSA CONUS standard M&IE and lodging. The tables are bundled files, not a live feed, so the same trip priced twice gives the same answer, and every rate carries the regulation, the source URL and the date it took effect. Nothing leaves your machine.\n\nBuilt by [theluckystrike](https://github.com/theluckystrike).\n\n\n## Install\n\n\n**One-click (.mcpb):** download `per-diem.mcpb` from the latest release and double-click it in Claude Desktop:\nhttps://github.com/theluckystrike/mcp-servers/releases/latest\n\n**Hosted, no install:** point a URL-based client at `https://mcp.zovo.one/mcp/per-diem`. `GET https://mcp.zovo.one/mcp/connect` mints a token and prints a ready URL.\n\nnpm publish for `@theluckystrike/mcp-per-diem` is pending, so the `npx` line below returns 404 today.\n\nClaude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"per-diem\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@theluckystrike/mcp-per-diem\"]\n    }\n  }\n}\n```\n\nClaude Code:\n\n```sh\nclaude mcp add per-diem -- npx -y @theluckystrike/mcp-per-diem\n```\n\nCursor (`~/.cursor/mcp.json` or `.cursor/mcp.json`): the same entry as Claude Desktop.\n\n## Tools\n\n| tool | what it does |\n| --- | --- |\n| `perdiem_rates` | List a scheme's bundled rates with the authority, instrument, source URL and effective date. Filter by country or city. |\n| `perdiem_calc` | Price one trip: the allowance per day and the total, with the partial-day fraction and the meal deductions the scheme's rule applies. |\n| `trip_record` | Calculate a trip and save it under a name, with the traveller from the shared business profile. |\n| `trip_list` | List saved trips with a total per currency. |\n| `trip_delete` | Delete a saved trip that has not been exported and has no expense booked against it, and free the free-tier slot it held. |\n| `trip_export` | The exact `expense_add` arguments for a saved trip, one payload per currency, for the expense-tracker server. |\n| `perdiem_report` | Totals per scheme and per calendar month, in each scheme's own currency. |\n| `license_status` | Free or Pro, and where to upgrade. |\n| `license_activate` | Activate a Pro key. Verified offline. |\n\n## Free vs Pro\n\n| | Free | Pro |\n| --- | --- | --- |\n| `perdiem_rates`, `perdiem_calc` | Yes, unlimited | Yes |\n| Trips saved per calendar month | 5, by start date | Unlimited |\n| `trip_list` | Yes, unlimited | Yes |\n| `trip_delete` | Yes, unlimited | Yes |\n| `trip_export` | No | Yes |\n| `perdiem_report` | No | Yes |\n\n[Get Pro](https://mcp.zovo.one/buy/per-diem): $19 one-time, or $39 for the bundle.\n\n## What is in the tables, and what is deliberately not\n\nEvery table under `src/tables/` carries a `header` with the authority, the instrument, the source URL, the date the rates took effect and the date they were read. `perdiem_rates` returns that header with the rates, so the provenance travels with the number.\n\nThe rule for what is in them: **a value that could not be stated with confidence from the public regulation text was left out, not guessed.** A per diem figure ends up on a tax return. A wrong one that looks authoritative is worse than an absent one, because an absent one is refused by name and you go and look it up.\n\n| table | bundled | left out |\n| --- | --- | --- |\n| Poland, domestic | The 45.00 PLN daily diet, the 150 percent lodging lump sum, and the partial-day and meal rules | The 20 percent local-transport lump sum is listed but not paid: it is not subsistence |\n| Poland, foreign | 34 countries of the annex, with the diet and its currency | The other roughly 90 countries, and every per-country lodging limit. A missing country means \"not verified here\", not \"no rate exists\" |\n| UK, domestic | All four HMRC benchmark scale rates (5, 10 and 15 hour bands and the late-evening supplement) | Nothing |\n| UK, overseas | **Nothing.** The file ships with an empty rate list and a header saying so | The whole per-city overseas scale-rate table: roughly 250 cities times eight figures each, in the destination currency. This build could not state them with confidence, so none of them is bundled. `perdiem_calc {scheme:\"uk\"}` refuses a foreign destination by name and points at the HMRC page |\n| US, GSA | The CONUS **standard** M&IE and lodging cap for FY2025 and FY2026, with the published meal breakdown | The roughly 300 non-standard localities (New York City, San Francisco and the rest). A destination that is not one of those takes the standard rate anyway, which is what this table gives |\n\nRates change. Check the `effective_date` in any answer before you rely on it, and read the `source_url` if the trip is recent.\n\n## Rules the calculator applies\n\n- **Start and end are instants, not wall clocks.** Pass ISO 8601 with an offset (`2026-03-28T22:00:00+01:00`) or a local datetime plus an IANA `timezone`. Elapsed hours are an epoch difference, so a trip across a clock change is 23 or 25 hours, not 24.\n- **Poland** counts 24-hour periods from departure. Under 24 hours domestically: nothing under 8 hours, half the diet from 8 to 12, the whole diet above 12. Over 24 hours: a whole diet per period, then half for a remainder up to 8 hours and a whole one above. Abroad the ladder is a third up to 8 hours, half over 8 and up to 12, whole above. Free meals take 25/50/25 percent off a domestic day and 15/30/30 off a foreign one.\n- **The UK** pays by band: 5.00 GBP from 5 hours away, 10.00 GBP from 10, 25.00 GBP from 15 when the journey is ongoing at 8pm, nothing under 5. A provided meal removes its share of the band, pro rata. HMRC states the principle (\"the rate is not payable for a meal that was provided\"); the pro-rata arithmetic is this server's reading of it, and it says so in the answer.\n- **The US** counts calendar days in the destination zone, at 75 percent of M&IE on the first and last day. A provided meal is deducted at its own published amount, and the 5.00 USD of incidentals is never deducted. Lodging is a **cap** on receipted reimbursement, not an allowance that is paid out; the answer says so every time.\n- **Currencies are never added together.** There is no exchange rate in this server, so a PLN diet and a EUR one stay two figures.\n\n## Exporting to the expense tracker\n\n`trip_export` returns the exact `expense_add` arguments for the [expense-tracker](../expense-tracker) server, one payload per currency, and writes nothing itself. That is deliberate: expense-tracker publishes no library entry point, and its id counter, its category rules, its VAT split and its currency defaults all live inside its own `expense_add` handler under its own lock. Appending a row to its `data.json` directly would produce an expense with none of those applied: one that looks native and is not. Handing back the arguments is the same contract [kanban](../kanban) uses for time-tracker's `timer_start`.\n\nNo `vat_rate` is set on the payload. A statutory per diem is an allowance, not a purchase, so there is no input VAT to reclaim on it.\n\n## A measured insight\n\n**Substring matching a country name is how a per diem gets quietly priced at another country's rate.**\n\nThe first build resolved a destination by exact name, then ISO code, then `country.includes(destination)`. A trip to Oman came back priced, in EUR, with no warning: `\"romania\".includes(\"oman\")` is `true`, so it took Romania's 42.00 EUR diet. Oman is not one of the 34 countries this build bundles, so the correct answer was a refusal naming the gap. Instead the caller got a confident number, in the wrong currency, from a country 3,000 km away.\n\nThe fix is one line, the fallback is a **prefix** match of four characters or more, and it is asserted in `test/adversarial.test.mjs`. The general form is worth more than the fix: a fuzzy match is safe when a miss is cheap and expensive when a miss is silent. Here a miss produces a tax figure, so the fallback has to fail closed. The table being deliberately partial is exactly what makes the substring fallback dangerous: with a complete table the wrong row is a near miss, and with a partial one it is a row that should never have matched at all.\n\n## Privacy\n\nEverything stays on your machine. Trips are JSON under `${XDG_DATA_HOME:-~/.local/share}/mcp-servers/per-diem/`. The rate tables are files inside the package. There is no network call anywhere in this server, no account and no API key. License keys are verified offline.\n\n## License\n\nMIT. Support: support@zovo.one\n",
  "bytes": 11088,
  "sha": "6fbad02016325715027937ec657337080722b5b4ee1050cd4dc72d1f0dccbeb0",
  "repo_slug": "theluckystrike/mcp-per-diem",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_theluckystrike_mcp_per_diem_a9a1906c/readme"
}