# REST API and MCP server

Guilder Desk has a REST API at /api/v1 with an OpenAPI 3.1 spec and an MCP server at /api/mcp with OAuth. Both are on Pro, via API key or MCP consent.

Guilder Desk exposes a REST API at `/api/v1` (OpenAPI 3.1 spec) and an MCP server at `/api/mcp` (OAuth); both are part of the Pro plan and run on the same logic as the app, so limits, roles and validation are identical everywhere.

## REST or MCP

| | REST API | MCP server |
|---|---|---|
| Address | `/api/v1` | `/api/mcp` |
| Authentication | API key (`Authorization: Bearer inv_...` or `x-api-key`) | OAuth with a consent screen |
| Use it for | integrations, scripts, accounting sync | AI agents: Claude, Cursor and other MCP clients |
| Scope | the full API: invoices, corrections, clients, products, KSeF, templates, client documents, time tracking, team | tools for invoices, clients, products, payments, client documents, time tracking, team and plan usage |
| Docs | `/api/v1/docs` | tool descriptions in your client |
| Plan | Pro | Pro |

## Docs and spec

- Interactive documentation: `/api/v1/docs`
- OpenAPI 3.1 spec: `/api/v1/openapi.json`

Amounts are integers in grosze (100 = PLN 1). Errors carry a readable code such as `validation` or `limit_reached`. When you exceed the rate limit you get a 429 with a `Retry-After` header; an API key is limited to 120 requests per minute.

## API keys

Create a key in Settings → API and agents → API keys. A key belongs to the organisation, has the prefix `inv_`, a role (never higher than yours), an expiry and scopes: read, write, send to KSeF, manage organisation. You see it in full only once, right after creating it. A key's permissions are the intersection of its role and scopes. Guide: [API keys and REST](https://guilder-desk.dev/en/help/ai-and-api/api-keys-and-rest).

```bash
curl -H "Authorization: Bearer inv_..." \
  "https://guilder-desk.dev/api/v1/orgs/{orgId}/invoices"
```

Sending to KSeF needs the send-to-KSeF scope and a role allowed to issue:

```bash
curl -X POST \
  -H "Authorization: Bearer inv_..." \
  "https://guilder-desk.dev/api/v1/orgs/{orgId}/invoices/{id}/ksef/send" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```

Sending to KSeF is irreversible, so it requires an explicit `confirm: true`. Issuing an invoice (`POST .../invoices/{id}/issue`) requires `confirm: true` as well. Check the spec for the remaining fields.

## MCP server

The server address is `https://guilder-desk.dev/api/mcp`. Your MCP client walks you through sign-in and a consent screen where you pick the organisation and scopes. OAuth client registration and client metadata documents (CIMD) are supported; the manage-organisation scope is not available to anonymously registered clients. You can revoke access under Account → Connected agents.

Example client configuration (the keys depend on the client, e.g. `mcpServers` in Cursor):

```json
{
  "mcpServers": {
    "guilder-desk": {
      "url": "https://guilder-desk.dev/api/mcp"
    }
  }
}
```

For Claude Code: `claude mcp add --transport http guilder-desk https://guilder-desk.dev/api/mcp`.

Tools: list and read invoices, create and edit drafts, issue, send to KSeF, payments, a PDF link, clients, products, members and plan usage, plus client documents: templates, drafts, client onboarding with a checklist, statuses and an invoice from a statement of work, and time tracking: projects, logging hours, unbilled hours and a draft invoice from hours (no confirmation needed, the result is a draft). Issuing, sending to KSeF, and finalizing or sending a document require `confirm: true`, and the agent should ask you first. You cannot issue corrections through MCP; do that in the app or over REST. On the Free plan the tools ask you to change plan.

More: [MCP for agents](https://guilder-desk.dev/en/help/ai-and-api/mcp-for-agents). Access rules: [security](https://guilder-desk.dev/en/security). Plans: [pricing](https://guilder-desk.dev/en/pricing).

*Updated 2026-11-21*
