> For the complete documentation index, see [llms.txt](https://docs.moderncollections.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moderncollections.io/clients/mcp.md). Agents can also search and read this documentation through its [MCP server](https://docs.moderncollections.io/~gitbook/mcp).

# MCP

Connect an AI assistant to Modern Collections and upload invoices, contracts, and supporting evidence.

Connect your MCP client to the sandbox to try tools with a test account.

| Setting        | Sandbox value                                        |
| -------------- | ---------------------------------------------------- |
| Server URL     | `https://api.demo.moderncollections.io/mcp`          |
| Transport      | Streamable HTTP                                      |
| Authentication | Sign in with your sandbox account or use its API key |

Use `account_whoami` to confirm the account before working with an invoice. For real placements, follow [Go live](https://docs.moderncollections.io/guides/go-live.md) and use the server URL from the production dashboard under **Settings → Developer & integrations**.

## Connect

### Sign in: Claude.ai, Claude Desktop, ChatGPT

No API key is needed.

1. Add a custom connector using the sandbox URL above. In Claude, open **Settings → Connectors → Add custom connector**. In ChatGPT, use a workspace that supports custom MCP connectors.
2. Choose **Connect** and sign in with your sandbox account.
3. Check which app is asking, which account it acts for and what it may do, then **Allow**.

| Permission                            | Covers                                                                                                       |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| View your account                     | Placements, payments, disputes, documents and reports                                                        |
| Make changes                          | Uploading and processing documents, acknowledging disputes, exports, settings                                |
| Start, stop or change debtor outreach | Placing and recalling invoices, posture, debtor details and contacts, recording payments, resolving disputes |

The last permission is off unless you tick it, because placing an invoice contacts the debtor. Without it a placing tool is refused until you reconnect and tick it, and `account_whoami` tells the assistant so.

* A partner user connects the partner once and names a linked creditor on each call with `creditor` (name, id or external reference). The connection reaches what the full API key reaches, within the granted permissions and the person's role; a viewer only reads.
* A creditor's member or viewer connects as themselves: the app acts with that person's role (a viewer's app only reads). Removing the person from the account disconnects every app they connected.
* Disconnect under **Settings → Developer & integrations → Connected apps → Revoke** (a partner: **Settings → API & webhooks → Connected apps**). Revoking does not change your API key; rotating the key does not disconnect apps.
* Whatever an app was granted, these stay in the dashboard: accepting the MSA, rotating the API key, the payout destination, settlement bounds, the webhook URL, the notification email.

### API key

Create the key in the dashboard under **Settings → Developer & integrations**; a partner's key is under **Settings → API & webhooks**. It is shown once. Send it as `Authorization: Bearer <API key>`, plus `X-MC-Creditor` for a partner key.

#### One command: Claude Code, Cursor, Claude Desktop

```bash
uv tool install modern-collections      # or: pip install modern-collections
modern-collections --base-url https://api.demo.moderncollections.io mcp install --client claude-code
```

It asks for your key without echoing it, checks it, then writes the client's configuration.

#### Any other client

Add the hosted server to the MCP client's configuration:

```json
{
  "mcpServers": {
    "modern-collections": {
      "url": "https://api.demo.moderncollections.io/mcp",
      "headers": {
        "Authorization": "Bearer ca_REPLACE_WITH_YOUR_KEY"
      }
    }
  }
}
```

### Check the setup

Reconnect the client, then ask the assistant to run `account_whoami`. It names the account, says whether it signed in or uses a key, and lists anything that blocks placing: verification, the MSA (accepted by a person in the dashboard), or the payout account. If something blocks, `getting_started` lists the setup steps in order. The assistant can save company details with `account_setup_update` until verification starts; the rest is finished in the dashboard. You can connect before the account is verified.

For a partner key or a partner user's sign-in, `account_whoami` lists the linked creditors; pass one as `creditor=` on each call. The partner tools act across the book and take no `creditor`:

| Tool                                                                                                                                                                                                                            | Does                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `partner_profile`, `partner_summary`, `partner_analytics`, `partner_top_debtors`                                                                                                                                                | Your profile; the book's totals, analytics and largest debtors                                                    |
| `partner_creditor_list`                                                                                                                                                                                                         | Linked creditors                                                                                                  |
| `partner_placement_list`, `partner_export`                                                                                                                                                                                      | Placements across the book; a CSV of placements, remittances, payments, documents or the audit trail              |
| `partner_remittance_list`, `partner_statement_list`, `partner_statement_lines`, `partner_statement_download_url`                                                                                                                | Every creditor's remittances and statements with totals; a statement's rows; a download link for one statement    |
| `partner_intake_draft_list`, `partner_evidence_request_list`, `partner_audit`                                                                                                                                                   | Invoices waiting for review, open document asks, your audit trail                                                 |
| `partner_notification_settings_get`, `partner_notification_settings_replace`                                                                                                                                                    | What you and your creditors hear, per event                                                                       |
| `partner_creditor_import`, `partner_creditor_import_status`, `partner_creditor_import_list`, `partner_placement_import`, `partner_placement_import_status`, `partner_placement_import_list`                                     | Bulk imports                                                                                                      |
| `partner_creditor_create`, `partner_creditor_update`, `partner_creditor_kyb_submit`, `partner_creditor_invite`, `partner_creditor_link_update`, `partner_creditor_recall_all`, `partner_evidence_request_fulfil`, `partner_tos` | Onboarding and operations; the creditor agreement you serve in your product                                       |
| `partner_webhook_events`, `partner_webhook_delivery_list`, `partner_webhook_redeliver`, `partner_level_webhook_redeliver`, `partner_webhook_test`                                                                               | The event catalogue; deliveries across your creditors; replaying one; sending a signed `webhook.test` to your URL |

Setting the partner webhook URL and the read-only key are not tools.

## What the assistant sees

A default set of 37 tools covers placing (from typed fields or from the invoice file), finding and following accounts, pausing and restarting one, undoing a recall, payments, disputes, documents, document asks and reporting. The full set of 130 (settlement floors, contact choices, committing a CSV in one call, the intake review queue, evidence scoring, notifications, webhooks, QuickBooks, partner tools) needs `?tools=all` on the URL or `X-MC-Tools: all`. A partner key or a partner user's sign-in also gets all 35 partner tools and `intake_draft_resolve` without opting in, 71 in all.

The assistant finds accounts by name: `placement_list(q="Acme")` searches by debtor company or invoice number. `placement_list(updated_since="2026-10-01T12:00:00Z")` returns what changed after that instant, oldest change first; see [Catching up after a missed webhook](https://docs.moderncollections.io/webhooks/receiving.md#catching-up-after-a-missed-webhook).

Open disputes: one `dispute_list` call for each open status (`open`, `reviewing`, `auto_responded`, `awaiting_human`, `awaiting_evidence`). A call with no `status` returns only the newest rows, so an old open dispute can be missing from it. A partner finds the disputed invoices under every creditor in one call with `partner_placement_list(status="disputed")`; an invoice disputed only in part keeps collecting and is not listed there.

## Confirmations

Tools that contact a debtor, move money, change who is contacted or make a legal statement are marked destructive. There are 29: `placement_create`, `placement_amend`, `placement_recall`, `placement_pause`, `placement_resume`, `placement_unrecall`, `placement_update_debtor`, `placement_set_contacts`, `placement_remove_contact`, `placement_set_settlement_floor`, `settlement_policy_set`, `settlement_policy_clear`, `payment_record`, `dispute_resolve`, `intake_csv_commit`, `intake_file_confirm`, `intake_draft_resolve`, `intake_identity_review_resolve`, `intake_email_set_senders`, `placement_set_legal_referral`, `account_setup_update`, `settings_update` (it can set `legal_referral_default`, which sends every future placement without its own setting to legal referral), `notification_settings_replace`, `qbo_disconnect`, `partner_placement_import`, `partner_creditor_recall_all`, `partner_creditor_invite`, `partner_creditor_link_update`, `partner_notification_settings_replace`. Review the account, invoice and requested action before confirming in your MCP client.

## Upload an invoice

Use a fictional business invoice from the [sandbox quickstart](https://docs.moderncollections.io/getting-started/quickstart.md#get-a-sandbox-key). Confirm the company and amount before placing it. Pass amounts as decimal strings. In production, an accepted placement can lead to outreach.

When you have the invoice file, the assistant places from the file:

1. `document_upload_link` with no `placement_id` returns a link that takes the invoice. An assistant with a shell on the machine that has the file posts the file to the link. Otherwise it gives you the link: open it in a browser and choose the file. The link works for 30 minutes and needs no login, so do not share it.
2. The file is read into a draft and nothing is placed. `intake_file_list` shows the draft.
3. `intake_file_confirm` with the `draft_id`, and `edits` for any field to correct. It creates the placement with the invoice on its documents.

In ChatGPT, a file you attach to the chat goes to `intake_file_upload` directly. A server running on your own machine reads a `file_path`.

With no file, or to type the fields:

1. `placement_create`: `company_name`, `invoice_amount` such as `"7500.00"`, `invoice_number`, `invoice_date`, `due_date`, and the AP email and phone and the debtor's state when known.
2. Attach the invoice: `document_upload_link(placement_id=..., document_type="invoice")` returns a link for that placement. The file goes through it the same way.
3. `placement_context` reads back what was extracted, once the document is processed.

Every other file on the debt (contract, statement, emails, delivery proof) goes on the placement through its link, which takes several files. Text the assistant already has, such as an email body, goes in `document_upload` as `content_text`. `document_type` is optional: each file is read and typed after upload.

An assistant never types a file out as base64: a long string copied by hand arrives corrupted. `content_base64` is for a program that already holds the bytes.

`placement_recall` stops outreach if the placement was a mistake.

```
document_upload_link()                                   # a new invoice
document_upload_link(placement_id="PLACEMENT_ID")        # more files on a placement
```

`document_status` shows processing progress; `placement_documents` lists a placement's documents. Formats and limits are in [Upload files](https://docs.moderncollections.io/rest-api/documents-1.md). The hosted server refuses `file_path`; it cannot see your disk.

## Not available to an assistant

Accepting the master service agreement, rotating the API key, and setting the webhook URL or the events it receives are done by a person in the dashboard. The intake webhook secret is kept out of the model.

For terminal commands, see [CLI](https://docs.moderncollections.io/clients/cli.md). For direct HTTP, see [REST quickstart](https://docs.moderncollections.io/getting-started/quickstart.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.moderncollections.io/clients/mcp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
