> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.lucanto.eu/llms.txt.
> For full documentation content, see https://docs.lucanto.eu/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.lucanto.eu/_mcp/server.

# MCP server

Lucanto ships a built-in [Model Context Protocol](https://modelcontextprotocol.io)
server, so AI agents can read and act on your workspace data — list and
create invoices, look up contacts, mark invoices paid, send them — using
the same API key and scopes as the REST API.

* **Endpoint:** `POST https://app.lucanto.eu/api/mcp/v1`
* **Transport:** Streamable HTTP (stateless)
* **Auth:** `Authorization: Bearer lct_pat_...` (a personal access token)

## Claude Desktop

Add Lucanto to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "lucanto": {
      "url": "https://app.lucanto.eu/api/mcp/v1",
      "headers": {
        "Authorization": "Bearer lct_pat_xxxxxxxxxxxx"
      }
    }
  }
}
```

Restart Claude Desktop, then ask: *"List my Lucanto workspaces"* — the agent
will call `lucanto_list_workspaces` and go from there.

## Tools & scopes

The tool catalog is filtered by your token's scopes — a `read:invoices`
token never sees write tools. Each tool carries behavior hints so clients
prompt appropriately (e.g. `lucanto_delete_invoice` is marked destructive,
`lucanto_send_invoice` reaches outside Lucanto).

| Scope tier | Example tools                                                                                                                     |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
| read       | `lucanto_list_workspaces`, `lucanto_list_invoices`, `lucanto_get_invoice`, `lucanto_list_contacts`, `lucanto_get_invoice_pdf_url` |
| write      | `lucanto_create_invoice`, `lucanto_update_invoice`, `lucanto_create_contact`                                                      |
| manage     | `lucanto_issue_invoice`, `lucanto_mark_invoice_paid`, `lucanto_send_invoice`, `lucanto_delete_invoice`                            |

Start with a narrowly-scoped token. Give an agent `read:*` to explore, and
only grant `write`/`manage` scopes once you trust the workflow.