# Build with AI: MCP server, Markdown docs and prompts

> Connect Claude and other AI tools to Anytime Capital Payments with the MCP server, give them the docs as Markdown, and paste a ready-made integration prompt.

Source: https://anytime-capital.com/docs/build-with-ai · Markdown: https://anytime-capital.com/docs/build-with-ai.md · All docs: https://anytime-capital.com/docs/llms-full.txt

Anytime Capital Payments is built to be integrated by AI assistants as easily as by people. Give your assistant the docs as Markdown so it writes the integration correctly, or connect it to the MCP server so it can create payment links and invoices and read your payments directly.

## Give your assistant the docs

| URL | What it is |
| --- | --- |
| [https://anytime-capital.com/docs/llms-full.txt](https://anytime-capital.com/docs/llms-full.txt) | Every docs page in one Markdown file. The best single link to hand an assistant. |
| [https://anytime-capital.com/docs.md](https://anytime-capital.com/docs.md) | The docs overview, with links to every page. |
| `https://anytime-capital.com/docs/<page>.md` | Any page on its own: add `.md` to its URL, e.g. [payment-links.md](https://anytime-capital.com/docs/payment-links.md). |
| [https://anytime-capital.com/llms.txt](https://anytime-capital.com/llms.txt) | The map of the whole Anytime Capital site for AI tools. |

Every docs page also has **Copy page** (its Markdown), **View as Markdown**, **Copy prompt for AI** (a prompt for that page's task, pointing at its Markdown) and **Open in Claude** (the same prompt in a new Claude conversation).

## The integration prompt

Paste this into Claude Code, Cursor or any coding assistant, in your project. It works with any language or framework.

**Integrate Anytime Capital Payments into my app**

```text
Integrate Anytime Capital Payments into this app so it can take payments.

First read the documentation: https://anytime-capital.com/docs/llms-full.txt
(Each page is also available on its own as Markdown, for example https://anytime-capital.com/docs/payment-links.md and https://anytime-capital.com/docs/webhooks.md.)

Requirements:
1. Work out the stack from this repository (language, framework, where server code runs, how secrets and environment variables are handled) and follow its existing patterns.
2. Read the secret API key from a server-side environment variable named ANYTIME_API_KEY (it starts with ak_live_). Never send it to the browser or a mobile app, never log it, never commit it.
3. Call the REST API at https://anytime-capital.com/api/v1 from server code only, with the header "Authorization: Bearer <key>". Amounts are integer cents in USD.
4. To take a payment for an order, create a payment link (POST /api/v1/payment-links) with "singleUse": true and the order id in "metadata", save the link id on the order, and send the customer to the link's "url". To bill a known customer with line items and a due date, create an invoice (POST /api/v1/invoices) instead.
5. Send an Idempotency-Key header on every POST: generate it once per operation (a UUID), store it with the order, and reuse it on retries so a retry never creates a second link or invoice.
6. Add a webhook endpoint that reads the raw request body and verifies the Anytime-Signature header: v1 is the hex HMAC-SHA256 of "<t>.<raw body>" keyed with the whsec_ signing secret from ANYTIME_WEBHOOK_SECRET; compare in constant time and reject timestamps more than 300 seconds old. Skip event ids it has already processed. On payment.succeeded, mark the order in data.metadata paid; also handle payment.failed, payment.refunded and dispute.opened.
7. Handle API errors by error.code (never by message text), show error.message where a person can fix it, and wait for Retry-After on 429.
8. Use only endpoints and fields the docs describe. If something I need isn't in the docs, tell me instead of guessing.

When you're done, list the environment variables I must set, the webhook URL to register in https://anytime-capital.com/dashboard/business/settings/developers (Settings → Developers → Add endpoint, event payment.succeeded and the others you handle), and how to test the flow end to end with a small real payment that I refund afterwards.
```

## Connect the MCP server

The MCP server at `https://anytime-capital.com/api/mcp` lets an assistant call the Payments API as tools. It speaks MCP over Streamable HTTP and takes the same API key as the REST API, in the same `Authorization` header, so the assistant has exactly the access the key gives: same validation, same [rate limit](https://anytime-capital.com/docs/rate-limits.md), same [idempotency](https://anytime-capital.com/docs/idempotency.md), same activity log.

> **Make a dedicated key:** Create a key just for your assistant in Settings → Developers (name it “Claude”, say) so you can revoke it on its own. Keep config files that contain the key out of version control.

### Claude Code

```bash
claude mcp add --transport http anytime-capital https://anytime-capital.com/api/mcp --header "Authorization: Bearer ak_live_..."
```

Add `--scope user` to use it in every project. Run `claude mcp list` to check it's connected, or `/mcp` inside a session. To share the server with a team without sharing a key, commit a `.mcp.json` that reads the key from each person's environment:

**.mcp.json**

```json
{
  "mcpServers": {
    "anytime-capital": {
      "type": "http",
      "url": "https://anytime-capital.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${ANYTIME_API_KEY}"
      }
    }
  }
}
```

### Cursor and other clients with remote HTTP servers

Clients that connect to remote MCP servers over HTTP with custom headers take a config like this (in Cursor, `~/.cursor/mcp.json` or `.cursor/mcp.json` in a project):

**mcp.json**

```json
{
  "mcpServers": {
    "anytime-capital": {
      "url": "https://anytime-capital.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ak_live_..."
      }
    }
  }
}
```

### Claude Desktop and local-only clients

Clients that only start local servers can reach the remote server through the open-source `mcp-remote` bridge, which needs Node.js. In Claude Desktop, open **Settings → Developer → Edit Config** and add:

**claude_desktop_config.json**

```json
{
  "mcpServers": {
    "anytime-capital": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://anytime-capital.com/api/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer ak_live_..."
      }
    }
  }
}
```

## Tools

| Tool | What it does | REST endpoint | Changes data |
| --- | --- | --- | --- |
| `list_payments` | List the business's payments (cards, card wallets and bank debits on payment links, invoices and subscriptions), newest first. Filter by status and by creation time. | `GET /api/v1/payments` | No |
| `get_payment` | Retrieve one payment by its id (pay_…): status, amounts in cents, net after fees, customer, payment method, metadata and any dispute. | `GET /api/v1/payments/{id}` | No |
| `list_payment_links` | List the business's payment links, newest first, each with its pay page url and the choices it offers buyers. Links behind invoices and subscription plans are not listed. | `GET /api/v1/payment-links` | No |
| `create_payment_link` | Create a hosted payment page for a single price and get back its url to share by text, email, DM or QR code. Customers pay by card, Apple Pay or Google Pay where available. | `POST /api/v1/payment-links` | Yes |
| `get_payment_link` | Retrieve one payment link by its id (pl_…), with its url, price, settings and buyer choices. | `GET /api/v1/payment-links/{id}` | No |
| `update_payment_link` | Change a payment link's title, description, what customers see after paying, terms consent, metadata, checkout questions, tips, quantity or shipping address. Send only what changes. The price can't change: create a new link instead. | `POST /api/v1/payment-links/{id}` | Yes |
| `deactivate_payment_link` | Stop a payment link taking payments. Anyone who opens it sees that it's closed; payments already made are kept. There is no API to reactivate it. Deactivating a link that is already off returns it unchanged. | `POST /api/v1/payment-links/{id}/deactivate` | Yes |
| `list_invoices` | List the business's invoices, newest first, with totals, what is paid and still owed, due date and pay page url. | `GET /api/v1/invoices` | No |
| `create_invoice` | Create an invoice from line items; totals are calculated for you. By default it is emailed to the customer straight away (send: false to hold it). The customer pays by card at the invoice's url. | `POST /api/v1/invoices` | Yes, and emails the customer |
| `get_invoice` | Retrieve one invoice by its id (inv_…): status, overdue, line items, totals, amount paid, balance and pay page url. | `GET /api/v1/invoices/{id}` | No |
| `send_invoice` | Email an invoice to its customer: the invoice itself the first time, a reminder after that. At most once every 24 hours per invoice, and only while something is still owed. | `POST /api/v1/invoices/{id}/send` | Yes, and emails the customer |
| `list_customers` | List the business's saved customers, newest first, or find one by email address. | `GET /api/v1/customers` | No |

Each tool's arguments are the endpoint's own fields (see the [API reference](https://anytime-capital.com/docs/payment-links.md)), plus `id` for one object and `idempotencyKey` on the tools that change something. Results are the API's JSON objects; errors come back as `{ status, error: { code, message } }` with `isError: true`, so the assistant can read the message and fix the call.

> **What an assistant can't do:** There are no tools for refunds, payouts or moving money: those stay in the dashboard. Tools that change data are marked as such, so clients like Claude ask before running them.

### Things to ask

- “Create a $250 payment link for a website audit and give me the link.”
- “Invoice Northwind LLC (ap@northwind.example) $4,500 for the website redesign, due November 15, with 8.25% tax.”
- “Which invoices are still open and past due? Send a reminder for each.”
- “How much did we take by card last week, and how much of it was refunded?”
- “Deactivate the Summer sale payment link.”

## Protocol details

| Detail | Value |
| --- | --- |
| Endpoint | `POST https://anytime-capital.com/api/mcp` |
| Transport | Streamable HTTP, stateless: each POST carries one JSON-RPC 2.0 message or a batch, and the answer is `application/json`. No sessions and no server-sent events; `GET` and `DELETE` answer `405`. |
| Protocol versions | `2025-06-18`, `2025-03-26`, `2024-11-05`. `initialize` answers with your version when it's one of these, otherwise `2025-06-18`. |
| Server name | `anytime-capital-payments` |
| Methods | `initialize`, `ping`, `tools/list`, `tools/call`. Notifications are accepted with `202` and no body. |
| Authentication | `Authorization: Bearer ak_live_…` on every request. `initialize` and `tools/list` work without a key so clients can discover the tools; `tools/call` without a valid key returns the API's `401` as a tool error. |

**Calling a tool directly**

```bash
curl https://anytime-capital.com/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer $ANYTIME_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "create_payment_link",
      "arguments": { "title": "Website audit", "amountCents": 25000, "idempotencyKey": "audit-2026-10" }
    }
  }'
```

**Result**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"object\": \"payment_link\",\n  \"id\": \"pl_…\",\n  \"url\": \"https://anytime-capital.com/pay/business/pl_…\",\n  …\n}"
      }
    ],
    "structuredContent": {
      "object": "payment_link",
      "id": "pl_…",
      "url": "https://anytime-capital.com/pay/business/pl_…",
      "…": "…"
    },
    "isError": false
  }
}
```

---

Anytime Capital is a fintech company, not a bank. Payment processing, banking and payout services are provided by Anytime Capital's licensed partners. Rates shown are for US card payments; international cards, currency conversion and disputes may carry additional fees shown in your dashboard before you accept a payment.
