Model Context Protocol
A hosted MCP server for collections
MCP is the open standard that lets AI agents call external tools without custom glue code. Point any MCP-capable client at Duebay’s endpoint and it gets late fees with the statute cited, dunning drafts, the live aging report and a send path that never lies about what went out, as first-class tools.
Setup
Add the server
Streamable HTTP transport, JSON-RPC 2.0, one URL, no local process to run.
Endpoint:
https://www.duebay.com/api/mcp
Config snippet for Claude Desktop, Claude Code, Cursor or any client that reads an mcpServers map. The snippet uses the sandbox key dc_test_sandbox, which always works on the three compute tools with zero signup. Swap in your own dc_test_ or dc_live_ key to unlock the data and send tools. The header can also be omitted entirely: the compute tools run keyless at the anonymous limit.
mcp config
{
"mcpServers": {
"duebay": {
"url": "https://www.duebay.com/api/mcp",
"headers": {
"Authorization": "Bearer dc_test_sandbox"
}
}
}
}Tools
What the server exposes
Seven tools over the same engine, statute library and send path the REST API and the app use. On deployments without a database, tools/list advertises only the compute tools, so an agent is never offered a tool it cannot call.
compute_late_fee
KeylessCompute a late fee from the agreed invoice terms, with the state statute (citation + confidence) alongside and a line-by-line derivation. Deterministic and keyless.
arguments { "balance_cents": 250000, "due_date": "2026-06-01", "state": "CA", "terms": { "type": "percent_monthly", "value": 1.5, "grace_days": 5 } }
draft_dunning_sequence
KeylessRender payment-reminder drafts (subject + body) for an invoice described inline: all four escalation steps, or one when `tone` is given. Composes only; never sends. Keyless.
arguments { "customer_name": "Acme Ltd", "business_name": "Beech Studio", "invoice_number": "INV-1042", "amount_cents": 250000, "due_date": "2026-06-01" }
get_late_fee_statute
KeylessOne state's late-fee / interest / prompt-payment statute entry with citations, sources and confidence. Unknown states return statute_unavailable, never an invented rate. Keyless.
arguments { "state": "CA" }
get_ar_aging
Requires a keyThe caller's live AR aging report + DSO (simple method, trailing 91 days, method stated). Requires an API key.
arguments {}
list_invoices
Requires a keyList the caller's invoices with outstanding balance, days overdue and chasing state. Filters: status, overdue, customer_id, limit. Requires an API key.
arguments { "overdue": true, "limit": 10 }
create_invoice
Requires a keyCreate an invoice, upserting its customer by name. Unknown fields are rejected with known_keys listed. Requires an API key.
arguments { "invoice_number": "INV-1042", "amount_cents": 250000, "issue_date": "2026-05-02", "due_date": "2026-06-01", "customer": { "name": "Acme Ltd", "email": "[email protected]" } }
send_reminder
Key + paid planActually send the next (or a specified) reminder for an invoice through the app's own send path. Logged as sent only when the provider accepted it. Requires a key on a paid plan.
arguments { "invoice_id": "INVOICE_ID" }
compute_late_fee
tools/call request
POST https://www.duebay.com/api/mcp
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "compute_late_fee",
"arguments": {
"balance_cents": 250000,
"due_date": "2026-06-01",
"as_of": "2026-07-15",
"state": "CA",
"terms": {
"type": "percent_monthly",
"value": 1.5,
"grace_days": 5
}
}
}
}response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\"data\":{\"fee_cents\":4839,\"fee\":48.39,\"basis\":\"ok\",\"days_overdue\":44,\"chargeable_days\":39,\"derivation\":[\"Invoice was due Jun 1, 2026; as of Jul 15, 2026 it is 44 days overdue.\",\"Minus the 5-day grace period agreed on the invoice: 39 chargeable days.\",\"Agreed rate: 1.5% per month, accrued per calendar month (not annualized to a daily rate).\",\"Chargeable period Jun 6, 2026 to Jul 15, 2026 = 1 full month + 9 days of a 31-day month = 1.2903 months.\",\"$2,500.00 x 1.5% x 1.2903 months = $48.39 (simple interest, not compounded).\",\"California law on agreed rates: Yes, subject to the constitutional usury limits of art. XV, § 1: for loans/forbearances NOT primarily for personal, family, or household purposes (i.e., business/commercial), the cap is the higher of 10% per annum or 5% over the Federal Reserve Bank of San Francisco discount rate (set as of the 25th day before the loan); consumer-purpose loans are capped at 10%. Exemptions swallow much of the rule: banks, savings associations, credit unions, industrial loan companies, licensed pawnbrokers, real-estate-broker-arranged loans secured by realty, and other statutorily exempt classes are not subject to the caps. Note usury law applies to loans/forbearances - bona fide trade credit and agreed charges on sales invoices are generally analyzed as forbearance only if credit is extended on an overdue debt. (Cal. Const. art. XV, § 1). Check your agreed rate against this before charging.\"],\"statute\":{\"state_code\":\"CA\",\"state_name\":\"California\",\"legal_interest_rate_pct\":10,\"interest_rate_citation\":\"Cal. Civ. Code § 3289(b); Cal. Const. art. XV, § 1\",\"interest_rate_summary\":\"For breach of contract - the situation covering overdue B2B invoices - Civ. Code § 3289(b) provides that if a contract entered into after Jan. 1, 1986 does not stipulate a rate, the obligation bears interest at 10% per annum after breach (excludes notes secured by real-property deeds of trust); a contractually stipulated lawful rate keeps running after breach (§ 3289(a)). Separately, the constitutional default \\\"legal rate\\\" for loans/forbearances generally is 7% per annum (art. XV, § 1). Both verified on the official leginfo.legislature.ca.gov site.\",\"contract_rate_summary\":\"Yes, subject to the constitutional usury limits of art. XV, § 1: for loans/forbearances NOT primarily for personal, family, or household purposes (i.e., business/commercial), the cap is the higher of 10% per annum or 5% over the Federal Reserve Bank of San Francisco discount rate (set as of the 25th day before the loan); consumer-purpose loans are capped at 10%. Exemptions swallow much of the rule: banks, savings associations, credit unions, industrial loan companies, licensed pawnbrokers, real-estate-broker-arranged loans secured by realty, and other statutorily exempt classes are not subject to the caps. Note usury law applies to loans/forbearances - bona fide trade credit and agreed charges on sales invoices are generally analyzed as forbearance only if credit is extended on an overdue debt.\",\"contract_rate_citation\":\"Cal. Const. art. XV, § 1\",\"prompt_payment_scope\":\"public+private-construction\",\"prompt_payment_rate_summary\":\"Public: California Prompt Payment Act (Gov. Code § 927 et seq.) - state agencies must pay undisputed invoices within 45 days of receipt or pay late-payment penalties (must dispute within 15 working days; enhanced penalties for small businesses). Private construction: Civ. Code § 8800 - owner must pay undisputed progress payments within 30 days of demand; violation carries a penalty of 2% per month on the amount wrongfully withheld in lieu of interest, plus prevailing-party attorney fees; owner may withhold up to 150% of a good-faith disputed amount. Related contractor-to-subcontractor prompt-pay provisions exist across the construction codes. No general private non-construction commercial prompt-pay act.\",\"prompt_payment_citation\":\"Cal. Gov. Code § 927 et seq.; Cal. Civ. Code § 8800\",\"late_fee_notes\":\"Flat late fees on commercial invoices are enforceable if they satisfy California's liquidated-damages doctrine (reasonable, not a penalty; California law presumptively favors liquidated-damages clauses in non-consumer contracts). In construction, the 2%/month prompt-payment penalty regime supplies the remedy for wrongful withholding. Interest-style late charges on trade credit can implicate usury as a \\\"forbearance\\\" if the transaction is recharacterized as a loan - the business-purpose cap (higher of 10% or FRBSF discount +5%) is the relevant ceiling for non-exempt creditors.\",\"sources\":[\"https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CIV§ionNum=3289\",\"https://leginfo.legislature.ca.gov/faces/codes_displayText.xhtml?lawCode=CONS&article=XV\",\"https://calconstructionlawblog.com/2013/07/09/an-overview-of-californias-prompt-payment-laws/\",\"https://www.levelset.com/prompt-payment/california-prompt-payment-faqs/\",\"https://law.justia.com/codes/california/2010/civ/8800-8802.html\"],\"confidence\":\"high\"},\"balance_cents\":250000,\"due_date\":\"2026-06-01\",\"as_of\":\"2026-07-15\",\"terms\":{\"type\":\"percent_monthly\",\"value\":1.5,\"grace_days\":5},\"statute_disclaimer\":\"Informational summary of state and federal statutes as researched on the sources listed per entry; not legal advice - verify current law with licensed counsel before relying on any rate or citation.\"},\"request_id\":\"req_1f2e3d4c5b6a79880911aabb\"}"
}
]
}
}draft_dunning_sequence
tools/call request
POST https://www.duebay.com/api/mcp
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "draft_dunning_sequence",
"arguments": {
"customer_name": "Acme Ltd",
"business_name": "Beech Studio",
"invoice_number": "INV-1042",
"amount_cents": 250000,
"due_date": "2026-06-01",
"as_of": "2026-07-15",
"payment_url": "https://pay.example.com/inv-1042",
"tone": "firm"
}
}
}response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\"data\":{\"sequence\":\"Standard chase\",\"as_of\":\"2026-07-15\",\"days_overdue\":44,\"drafts\":[{\"tone\":\"firm\",\"offset_days\":14,\"send_on\":\"2026-06-15\",\"subject\":\"Second notice: invoice INV-1042 is 44 days overdue\",\"body\":\"Hi Acme Ltd,\\n\\nThis is a second reminder about invoice INV-1042 for $2,500.00, now 44 days past its Jun 1, 2026 due date.\\n\\nWe'd like to get this resolved this week. If there's a problem with the invoice or you need to discuss timing, reply to this email and we'll work it out.\\n\\nPay online: https://pay.example.com/inv-1042\\n\\nRegards,\\nBeech Studio\"}],\"note\":\"These are drafts. Nothing was sent: sending goes through POST /api/v1/invoices/{id}/remind (paid plans) or your own email tooling.\"},\"request_id\":\"req_1f2e3d4c5b6a79880911aabb\"}"
}
]
}
}get_late_fee_statute
tools/call request
POST https://www.duebay.com/api/mcp
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_late_fee_statute",
"arguments": {
"state": "CA"
}
}
}response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\"data\":{\"statute\":{\"state_code\":\"CA\",\"state_name\":\"California\",\"legal_interest_rate_pct\":10,\"interest_rate_citation\":\"Cal. Civ. Code § 3289(b); Cal. Const. art. XV, § 1\",\"interest_rate_summary\":\"For breach of contract - the situation covering overdue B2B invoices - Civ. Code § 3289(b) provides that if a contract entered into after Jan. 1, 1986 does not stipulate a rate, the obligation bears interest at 10% per annum after breach (excludes notes secured by real-property deeds of trust); a contractually stipulated lawful rate keeps running after breach (§ 3289(a)). Separately, the constitutional default \\\"legal rate\\\" for loans/forbearances generally is 7% per annum (art. XV, § 1). Both verified on the official leginfo.legislature.ca.gov site.\",\"contract_rate_summary\":\"Yes, subject to the constitutional usury limits of art. XV, § 1: for loans/forbearances NOT primarily for personal, family, or household purposes (i.e., business/commercial), the cap is the higher of 10% per annum or 5% over the Federal Reserve Bank of San Francisco discount rate (set as of the 25th day before the loan); consumer-purpose loans are capped at 10%. Exemptions swallow much of the rule: banks, savings associations, credit unions, industrial loan companies, licensed pawnbrokers, real-estate-broker-arranged loans secured by realty, and other statutorily exempt classes are not subject to the caps. Note usury law applies to loans/forbearances - bona fide trade credit and agreed charges on sales invoices are generally analyzed as forbearance only if credit is extended on an overdue debt.\",\"contract_rate_citation\":\"Cal. Const. art. XV, § 1\",\"prompt_payment_scope\":\"public+private-construction\",\"prompt_payment_rate_summary\":\"Public: California Prompt Payment Act (Gov. Code § 927 et seq.) - state agencies must pay undisputed invoices within 45 days of receipt or pay late-payment penalties (must dispute within 15 working days; enhanced penalties for small businesses). Private construction: Civ. Code § 8800 - owner must pay undisputed progress payments within 30 days of demand; violation carries a penalty of 2% per month on the amount wrongfully withheld in lieu of interest, plus prevailing-party attorney fees; owner may withhold up to 150% of a good-faith disputed amount. Related contractor-to-subcontractor prompt-pay provisions exist across the construction codes. No general private non-construction commercial prompt-pay act.\",\"prompt_payment_citation\":\"Cal. Gov. Code § 927 et seq.; Cal. Civ. Code § 8800\",\"late_fee_notes\":\"Flat late fees on commercial invoices are enforceable if they satisfy California's liquidated-damages doctrine (reasonable, not a penalty; California law presumptively favors liquidated-damages clauses in non-consumer contracts). In construction, the 2%/month prompt-payment penalty regime supplies the remedy for wrongful withholding. Interest-style late charges on trade credit can implicate usury as a \\\"forbearance\\\" if the transaction is recharacterized as a loan - the business-purpose cap (higher of 10% or FRBSF discount +5%) is the relevant ceiling for non-exempt creditors.\",\"sources\":[\"https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CIV§ionNum=3289\",\"https://leginfo.legislature.ca.gov/faces/codes_displayText.xhtml?lawCode=CONS&article=XV\",\"https://calconstructionlawblog.com/2013/07/09/an-overview-of-californias-prompt-payment-laws/\",\"https://www.levelset.com/prompt-payment/california-prompt-payment-faqs/\",\"https://law.justia.com/codes/california/2010/civ/8800-8802.html\"],\"confidence\":\"high\"}},\"request_id\":\"req_1f2e3d4c5b6a79880911aabb\"}"
}
]
}
}get_ar_aging
tools/call request
POST https://www.duebay.com/api/mcp
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_ar_aging",
"arguments": {}
}
}response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\"data\":{\"as_of\":\"2026-07-15\",\"total_outstanding_cents\":419000,\"overdue_cents\":330000,\"overdue_invoice_count\":2,\"open_invoice_count\":3,\"buckets\":[{\"key\":\"current\",\"label\":\"Current\",\"amount_cents\":89000,\"invoice_count\":1},{\"key\":\"d1_30\",\"label\":\"1-30 days\",\"amount_cents\":80000,\"invoice_count\":1},{\"key\":\"d31_60\",\"label\":\"31-60 days\",\"amount_cents\":250000,\"invoice_count\":1},{\"key\":\"d61_90\",\"label\":\"61-90 days\",\"amount_cents\":0,\"invoice_count\":0},{\"key\":\"d90_plus\",\"label\":\"91+ days\",\"amount_cents\":0,\"invoice_count\":0}],\"largest_overdue\":{\"invoice_number\":\"INV-1042\",\"customer_name\":\"Acme Ltd\",\"amount_cents\":250000,\"days_overdue\":44},\"dso\":{\"days\":83.1,\"period_days\":91,\"formula\":\"DSO = (accounts receivable / credit sales in period) x days in period\",\"method\":\"Simple method over the trailing 91 days: receivables outstanding as of the report date, divided by the total value of invoices issued in the trailing 91 days (the closest available proxy for credit sales), times 91.\"}},\"request_id\":\"req_1f2e3d4c5b6a79880911aabb\"}"
}
]
}
}Anonymous calls to the compute tools are rate-limited to 4/min and 20/day per IP; the sandbox key raises that to 10/min and 200/day with zero signup. A free dc_test_ key (create one in Settings) adds the data tools against your own book and never bills. Production limits need a dc_live_ key: 60/min and 2,000 calls/mo on Pro, up to 300/min and 10,000/mo on Scale, and send_reminder needs a paid plan. See pricing for the full table.
Duebay computes late fees and interest from state statutes and the terms on your invoice, and shows the citation behind every number. It is general information, not legal advice: statutes change and contracts vary, so confirm with counsel before relying on a figure in a dispute. Where a rule could not be verified, Duebay says "verify with counsel" rather than guessing.