
Delegacja
io.github.theluckystrike由 GitHub 帳號 theluckystrike 發布v0.22.6更新於 Oct 24, 2026
Policz diete za delegacje krajowa i zagraniczna wedlug rozporzadzenia oraz stawek HMRC i GSA.
概覽
本機 MCP 伺服器,依波蘭差旅規定、英國 HMRC 標準費率與美國 GSA 費率計算出差每日津貼,並保存已計價的行程。
- 可以做什麼
- 依方案、國家或城市查詢內建費率表,每筆費率附上主管機關、來源與生效日期。為單一旅程計價:每日津貼與總額,並顯示不足整日的折算比例與餐食扣減。儲存、列出與刪除已計價行程,並依方案與曆月彙總。為已儲存行程產生費用記錄工具所需的參數,每種貨幣一份。離線查詢或啟用 Pro 授權。
- 適用情境
- 需要波蘭、英國或美國的差旅津貼金額,並希望同時看到計算規則與費率出處而非手算表格時適用。也適合維護少量已計價行程紀錄並轉為費用項目。
- 執行需求
- 以本機程序在使用者電腦上執行,透過 .mcpb 套件安裝於 Claude Desktop(僅桌面版)。不需帳號、API 金鑰或網路連線;費率表為內建檔案,行程以 JSON 存放在本機資料目錄。選用的 Pro 授權金鑰透過環境變數 MCP_LICENSE_KEY 提供。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Delegacja,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-per-diem
Work 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.
Built by theluckystrike.
In the official MCP Registry (io.github.theluckystrike/per-diem).
Install
One-click (.mcpb): download per-diem.mcpb from the latest release and double-click it in Claude Desktop:
https://github.com/theluckystrike/mcp-servers/releases/latest
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.
npm publish for @theluckystrike/mcp-per-diem is pending, so the npx line below returns 404 today.
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
Claude Code:
Cursor (~/.cursor/mcp.json or .cursor/mcp.json): the same entry as Claude Desktop.
Tools
Free vs Pro
Get Pro: $19 one-time, or $39 for the bundle.
What is in the tables, and what is deliberately not
Every 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.
The 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.
Rates change. Check the effective_date in any answer before you rely on it, and read the source_url if the trip is recent.
Rules the calculator applies
- 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 IANAtimezone. Elapsed hours are an epoch difference, so a trip across a clock change is 23 or 25 hours, not 24. - 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.
- 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.
- 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.
- Currencies are never added together. There is no exchange rate in this server, so a PLN diet and a EUR one stay two figures.
Exporting to the expense tracker
trip_export returns the exact expense_add arguments for the 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 uses for time-tracker's timer_start.
No 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.
A measured insight
Substring matching a country name is how a per diem gets quietly priced at another country's rate.
The 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.
The 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.
Privacy
Everything 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.
License
MIT. Support: [email protected]
Use these docs as an MCP server
Any MCP client (Claude, Cursor, Windsurf, VS Code) can read this repository's documentation directly via GitMCP - no install:
- Docs MCP URL: https://gitmcp.io/theluckystrike/mcp-per-diem
來源:servers/per-diem/README.md,提交 6535b33
工具
0版本歷史
3- v0.22.6最新Oct 14, 2026
- v0.22.3Sep 23, 2026
- v0.21.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分