
Freelancer Payment Protection
io.github.RudrenduPaul由 GitHub 帳號 RudrenduPaul 發布v0.1.6更新於 Oct 25, 2026
Wraps the fpp CLI as a single generic MCP tool for freelancer client payment-risk checks.
概覽
一個本機 MCP 伺服器,提供單一通用工具來呼叫 freelancer-payment-protection 命令列,讓助理查詢發票、客戶、催收階段與付款風險評分。
- 可以做什麼
- 透過一個通用工具執行任意 fpp 命令列子命令,並盡可能以結構化 JSON 回傳輸出。列出、建立發票並更新其狀態,列出或檢視客戶。計算並重新整理客戶的 0-100 付款風險評分,含因素拆解與 AI 推理。檢視催收階段與歷史,並預覽下一階段的 AI 起草催款郵件。產生引用司法管轄區的律師函,並管理每張發票的證據檔案。
- 適用情境
- 適合已自行執行 freelancer-payment-protection 後端、希望助理直接查看逾期發票、客戶風險評分或催收階段而不必自己呼叫命令列的情況。它只是薄封裝,不使用該後端時價值有限。
- 執行需求
- 以本機程序執行;需安裝含 mcp 附加元件的套件以提供 fpp-mcp 指令,且機器上需有 fpp 命令列。它連線自架的 freelancer-payment-protection API 執行個體,透過 FPP_API_URL 環境變數指定。登入後會在本機快取憑證;AI 功能需要後端設定 ANTHROPIC_API_KEY,網頁儀表板需要 Supabase 專案。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Freelancer Payment Protection,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
freelancer-payment-protection
[npm version] [PyPI version] [last commit] [coverage 70%+ enforced] [CodeQL enabled] [License: MIT]
Full tech stack badges
[Python 3.12] [FastAPI 0.111] [Next.js 14 App Router] [TypeScript 5.4] [Turborepo monorepo] [Claude Sonnet 4.6 AI core] [Supabase PostgreSQL + RLS] [Celery + Redis workers] [Framer Motion animations] [Row Level Security on all tables]
Claude drafts jurisdiction-referenced demand letters and 0–100 client risk scores with full reasoning, wired into a self-hosted FastAPI + Next.js dashboard and a scriptable CLI.
[CI status] [PyPI version] [npm version] [License: MIT] [CodeQL enabled]
Built by Rudrendu Paul & Sourav Nandy
[fpp CLI: logging in and listing overdue invoices against a live workspace]Note on the license: this project is MIT licensed. Copyright is held by Rudrendu Paul and Sourav Nandy. See License below for full terms.
Install the CLI
That installs fpp, a typed command-line client for the FastAPI backend below (invoices, escalations, client risk scoring, --json on every data command). It talks to a freelancer-payment-protection API instance you run yourself. See Run the full stack locally to stand one up, or point FPP_API_URL at one that's already running.
Table of Contents
- What This Is
- Features
- Run the full stack locally
- Command-Line Interface
- API Reference
- Comparison
- Architecture
- MCP Server
- Security
- What's Not Implemented Yet
- FAQ
- Contributing
- License
What This Is
FreshBooks and HoneyBook stop at "invoice sent." Neither drafts what to say when a client goes quiet, and neither scores a client's risk of non-payment before you start the work. This project is a FastAPI + Next.js app, backed by Claude, that does two specific things well: it drafts a stage-appropriate escalation email or a jurisdiction-referenced demand letter for an overdue invoice, and it scores a client's payment risk from 0–100 with a full factor breakdown, both with an AI-generated confidence/reasoning trail a human reviews before anything goes out.
It is not a set-and-forget automation system. There's no background scheduler enforcing wait times between stages and no live sync with FreshBooks/QuickBooks/Wave today. See What's Not Implemented Yet for the honest gap between the architecture diagram and what's wired up. What's real: the AI drafting, the risk scoring, the evidence locker, and a CLI that scripts all three.
Features
Run the full stack locally
Verified against a fresh clone. Prerequisites: Node.js 20+, pnpm 9.x, Python 3.12.x (3.13/3.14 aren't supported by this checkout: 3.14 fails at pip install for one of the pinned backend dependencies).
[!WARNING] Requires Python 3.12.x specifically. 3.13 and 3.14 are not yet supported.
The seed script needs no external services and produces 8 clients, 16 invoices, and pre-generated escalation events, all queryable through the API or the CLI once seeded. Verified end to end in a fresh venv: alembic upgrade head runs clean, seed_dev.py populates SQLite, and uvicorn app.main:app boots and serves /health and /health/ready once the two .env fixes above are applied.
Logging into the web dashboard needs a real (free tier is fine) Supabase project. apps/api/app/middleware/auth.py validates a Supabase-issued JWT with no local bypass. The seeded data is fully reachable through the API/CLI without one. AI features (demand letters, risk scoring, escalation drafts) need a real ANTHROPIC_API_KEY in apps/api/.env; without one, risk scoring falls back to the heuristic score and the other two AI routes return a 503.
Command-Line Interface
Verified against the installed package's actual --help output.
--status on invoice list accepts disputed, overdue, paid, pending, written_off. Full flag reference for any command: fpp <command> --help. Full install, config, and auth walkthrough: packages/cli/README.md.
API Reference
Interactive OpenAPI at http://localhost:8000/docs. Verified against the router source directly:
Comparison
Every non-freelancer-payment-protection row below is sourced from each vendor's own docs/help center, checked in August 2026.
The honest read: FreshBooks and HoneyBook are stronger at the mechanical, rule-based reminder they already do well. HubSpot's June 2026 Breeze beta is the closest thing to a competing risk-scoring feature on this list and is worth watching. Nobody here drafts a jurisdiction-referenced demand letter or streams AI generation into the UI; that's the actual gap this project fills, not "full collection automation," which none of these, including this project, deliver end to end yet.
Architecture
System diagram (what's actually implemented)
Celery and Redis are declared dependencies (requirements.txt) with no worker code in the repository today: no apps/workers/ directory exists, and there is no scheduled job that advances an invoice's stage automatically. See What's Not Implemented Yet.
Why Python for the backend, not Node
Legal document drafting uses python-docx/WeasyPrint in the code paths that are wired up for it, and the Anthropic Python SDK is the reference implementation. The Python ecosystem is also where contract-analysis tooling (NLTK, spaCy) would live for a future dispute-analysis feature.
Why centralize all Claude calls in one file
packages/legal_ai/client.py (called from apps/api/app/services/ai_service.py) is the only place the Anthropic SDK is imported. Model version, retries, and the sync-SDK/async-FastAPI bridge live there, so upgrading the model is a one-file change.
Why Pydantic Settings with fail-fast validation
settings = Settings() runs at import time. If ANTHROPIC_API_KEY is absent, the app raises before serving a request rather than degrading silently. The tradeoff: the settings model is strict about unrecognized fields too, which is the root cause of one of the two .env.example issues in the FAQ below.
Every data-returning command also takes --json for structured output an agent or script can parse directly:
MCP Server
freelancer-payment-protection-cli ships a Model Context Protocol (MCP) server, so an
agent (Claude Desktop, Claude Code, or any other MCP client) can call the same commands
above (invoice list, client risk, escalation status, ...) as tool calls instead of
shelling out to the CLI directly.
Install:
Claude Desktop config (claude_desktop_config.json):
The server exposes one tool, run, that shells out to the installed fpp binary with
the given argument list and returns its output as structured JSON when possible — every
fpp subcommand is reachable through it, not just a hand-picked subset. Example call:
run(args=["client", "risk", "<client-id>", "--json"]) returns the same 0-100 risk
score, factor breakdown, and AI reasoning that fpp client risk <client-id> --json
prints to a terminal.
Security
What's Not Implemented Yet
Being direct about this because the architecture diagrams and dependency list overstate it otherwise:
- No background worker or scheduler.
celeryandredisare pinned inrequirements.txt, but noapps/workers/code exists in the repository. Nothing advances an invoice's escalation stage automatically or on a timer. - No minimum-wait-time enforcement.
escalation_service.py'sget_next_stage()is a plain ordered lookup with no date/timedelta check anywhere in the call path. Any authenticated caller can request a draft for the next stage regardless of how long the invoice has been overdue; the endpoint also never writes the new stage back to the invoice. - No FreshBooks/QuickBooks/Wave sync.
packages/integrations/__init__.pyis an empty file. Invoices are created through the API/CLI, not synced from an accounting tool. - No production PDF/DOCX export yet.
doc_gen_service.py's docstring says it plainly: dev builds save the drafted letter as a.txtfile; thepython-docx/WeasyPrint production path is not wired up. - No evidence ZIP export. The evidence router supports list/upload/delete only.
None of this is secret. It's what running the code shows. The parts that are real (AI drafting, risk scoring with reasoning, streaming, the CLI) are described above with specifics, not adjectives.
FAQ
What is this, and what's the actual differentiator versus FreshBooks or HoneyBook?
Both of those handle sending an invoice and reminding a client on a fixed schedule. Neither drafts a jurisdiction-referenced legal demand letter or scores a client's payment risk with an AI-generated reasoning trail. This project does both, backed by a real Claude API call you can see in packages/legal_ai/ and apps/api/app/services/, not a canned template swap.
Is this open source? Can I fork it or use the code in my own project?
Yes. The repository is MIT licensed: fork it, modify it, or embed the code in your own project, subject only to the standard MIT terms in LICENSE (keep the copyright/permission notice). The freelancer-payment-protection-cli package on PyPI/npm is installable and runnable as-is under the same license.
What platforms does the CLI support?
Python 3.10–3.13 on Linux, macOS, or Windows, installed via pip, uvx, or pipx. The npm package (freelancer-payment-protection-cli on npm) is a thin wrapper that shells out to uvx or pipx at runtime rather than bundling a platform binary; it needs one of those two on PATH. Running the full backend/frontend stack needs Python 3.12.x specifically; 3.13/3.14 aren't supported by the current dependency pins.
How is this different from HubSpot's new Breeze Invoice Prioritization feature?
Breeze (Revenue Hub, public beta as of June 2026) ranks a HubSpot user's overdue invoices by risk, age, and customer value, closer to a sort order than a score. fpp client risk returns a 0–100 score with a named-factor breakdown and a written reasoning paragraph per client, works standalone without adopting the rest of HubSpot's CRM, and pairs with jurisdiction-referenced demand-letter drafting that HubSpot doesn't offer. Worth revisiting as Breeze comes out of beta.
I followed the Quick Start exactly and uvicorn app.main:app --reload crashed on startup. Is that a bug?
Yes, a real one in the shipped apps/api/.env.example. Two of its default values don't survive Settings()'s validation: ALLOWED_ORIGINS=http://localhost:3000 needs to be a JSON array (["http://localhost:3000"]) because the field is typed list[str], and DATABASE_URL=sqlite:///./dev.db isn't a field the Settings model declares at all, so it fails with Extra inputs are not permitted. Fix both lines in your .env (or just delete the DATABASE_URL line; apps/api/app/database.py already defaults to that same SQLite path independently) and the server boots. Confirmed by running the documented steps in a clean clone.
Does fpp escalation advance actually send the email or move the invoice forward?
No. It calls /api/v1/escalations/{id}/draft, which returns an AI-drafted preview only. The backend has no endpoint today that persists a stage change or sends the email. See What's Not Implemented Yet.
What happens if I don't have an ANTHROPIC_API_KEY set?
The app still starts once the two .env fixes above are applied, but the AI routes behave differently: client risk falls back to a deterministic heuristic score (documented in risk_service.py), while escalation advance and the demand-letter endpoints return a 503 with no fallback.
Can I use this for a real client engagement today? For the CLI against your own self-hosted backend and Supabase project, yes. The MIT license also permits using or embedding this in a real client engagement or your own product; see License for the exact terms.
Contributing
GitHub Issues are open for bug reports and feature requests. Pull requests are welcome; open an issue first for anything non-trivial so the approach can be agreed on before you put in the work. Reach out via github.com/RudrenduPaul with questions.
License
MIT. See LICENSE for full terms.
Contact: github.com/RudrenduPaul
Built by Rudrendu Paul and Sourav Nandy · Developed with Claude Code
來源:README.md,提交 742785d
工具
0版本歷史
1- v0.1.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分