# MCP server

> Connect Cursor, Claude Code, or any MCP client.

Page: https://doxtract.manoonlabs.com/docs/mcp

## Endpoint

|  |  |
| --- | --- |
| URL | `POST https://doxtract.manoonlabs.com/mcp` |
| Transport | Streamable HTTP, JSON-RPC 2.0, one JSON body |
| Protocol | `2025-06-18` |
| Server name | `doxtract` |
| Methods | `initialize`, `ping`, `tools/list`, `tools/call` |

## Connect a client

- Create a key on [API Keys](https://doxtract.manoonlabs.com/settings/developer) and copy the secret.
- Add the config below. Cursor reads `.cursor/mcp.json`. Claude Code registers the server from a terminal.
- Call `whoami` to confirm the workspace, then `parse_document`.

**Cursor**

```json
{
  "mcpServers": {
    "doxtract": {
      "url": "https://doxtract.manoonlabs.com/mcp",
      "headers": {
        "Authorization": "Bearer mldxt_..."
      }
    }
  }
}
```

**Claude Code**

```bash
claude mcp add --transport http doxtract https://doxtract.manoonlabs.com/mcp \
  --header "Authorization: Bearer mldxt_..."
```

## Authentication

`initialize`, `ping`, `tools/list` and notifications answer without a key. `tools/call` needs one, sent as `Authorization: Bearer <key>` or `x-api-key: <key>`. Each parsed page costs 1 credit, the same as REST.

## Tools

Arguments are the REST JSON keys. Where REST reads `{slug}` from the path, the argument is `slug`. `parse_document` takes the file as `file_base64` or plain text as `text`. Every tool acts on the workspace that owns the key.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `whoami` | Return the workspace and token for the bearer credential, and the credits left this month. | none |
| `parse_document` | Extract structured fields from a PDF, PNG, JPEG, or text file sent as base64 in file_base64, or from plain text sent in text (10 MB and 10 pages on Free, 25 MB on Starter and Pro, 100 MB on Business; pages per document by plan: Starter 50, Pro 200, Business 500). 1 credit per page; an image is 1 page; text is 1 credit per 3,000 characters. The file is deleted after processing. Send exactly one of file_base64 or text. The result has status and values. Set citations to true to also get, for each value, the page, the printed text, and a box where it was read. | `schema`, `file_base64`, `text`, `citations`, `password`, `strict` |
| `list_schemas` | List the extraction schemas saved in this workspace. | none |
| `get_schema` | Read one saved extraction schema by slug. | `slug` (required) |
| `create_schema` | Save an extraction schema in this workspace. The slug (API id) is derived from the display name. A schema is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes. | `name` (required), `schema` (required) |
| `update_schema` | Update a saved schema's display name and/or definition. A schema is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes. | `slug` (required), `name`, `schema` |
| `list_inboxes` | List the inboxes this key can see, newest first, up to 200. Each has its id, name, icon, status, document count and email address. A key limited to some inboxes sees only those. | none |
| `get_inbox` | Read one inbox: its name, icon, status, document count, email address, and its fields as a JSON schema (schema, null for a draft with no fields yet). The fields show what kind of document the inbox reads, so use them to decide which inbox a document belongs in. | `inbox_id` (required) |
| `upload_document` | Add one document to an inbox. It is read with the inbox's fields in the background, the same as a document dropped into the inbox in the console, and costs 1 credit per page. Send the file as file_base64 (a PDF, PNG or JPEG) with its file_name. Returns the new document's id. Upload only to the inbox the document belongs in: call get_inbox to read an inbox's fields when you are not sure. | `inbox_id` (required), `file_name` (required), `file_base64` (required) |
| `create_inbox` | Create an inbox in this workspace and return its id and email address. Send template (a built-in template slug: invoice, receipt, bank_statement, purchase_order) to make it ACTIVE with that template's fields, the same as creating one in the console. Without a template it is a DRAFT that does not parse yet. | `name` (required), `template`, `icon` |
| `create_inbox_from_schema` | Create an active inbox from a schema you send, in the same format as saved fields. The inbox gets its own fields, its email address is returned, and mail and uploads are parsed at once. This path is for the API and MCP only; the console does not offer it. | `name` (required), `schema` (required), `icon` |
| `update_inbox` | Change an inbox's name, icon and/or fields. Send any of name, icon and schema. Send icon as null to go back to the default icon. Renaming does not change the email address. A schema replaces an ACTIVE inbox's fields, in the same format as create_inbox_from_schema; documents already parsed keep their values until they are re-run in the console. A draft refuses a schema (409 not_active). | `inbox_id` (required), `name`, `icon`, `schema` |
| `get_inbox_email` | Read an inbox's email address and whether it accepts mail. The address is created the first time it is read. | `inbox_id` (required) |
| `set_inbox_email_enabled` | Turn mail receiving on or off for one inbox. The address does not change. Documents already in the inbox are not affected. | `inbox_id` (required), `enabled` (required) |
| `set_inbox_webhook` | Save where an inbox sends each parsed document, so documents that arrive by email or upload reach your system without a poll. Each body is signed with the returned secret. An empty url turns the webhook off and forgets the URL. Send enabled false to pause sending (the console's Send automatically switch) and keep the URL, true to resume. Changing url, auth or headers needs a key created by the workspace owner; enabled alone does not. | `inbox_id` (required), `url`, `enabled`, `auth_type`, `username`, `secret`, `headers` |
| `get_inbox_webhook` | Read an inbox's webhook settings: the URL, whether documents are sent automatically (enabled), the receiver's auth type and the custom header names. A key created by the workspace owner also gets the signing secret; other keys get null. | `inbox_id` (required) |
| `rotate_inbox_webhook_secret` | Replace an inbox's webhook signing secret with a new one and return it. Calls signed with the old secret stop verifying at once, so update your receiver right after. Only a key created by the workspace owner can do this. | `inbox_id` (required) |
| `list_webhook_deliveries` | List an inbox's webhook calls, newest first, up to 100: the event, the document, the HTTP status, whether it succeeded, the error and the start of the endpoint's answer. The same call log as the console. | `inbox_id` (required), `limit` |
| `resend_document_webhook` | Send one parsed document's values to the inbox's webhook again, now. Recorded as a manual attempt in the call log. Returns whether the endpoint accepted it. | `inbox_id` (required), `document_id` (required) |
| `delete_inbox` | Delete an inbox with all its documents, their files and values, its fields and its webhook call log. This cannot be undone. Its email address stops working. | `inbox_id` (required) |
| `list_documents` | List an inbox's documents, newest first, 20 a page (page_size up to 100). Each has its id, file name, status (QUEUED, ANALYZING, PARSED or FAILED), pages, credits and failure reason. Filter with status. Values are not included: call get_document. | `inbox_id` (required), `page`, `page_size`, `status` |
| `get_document` | Read one document of an inbox: its status, file name, pages, credits and failure reason, and once parsed its values (with any edits made in the console) and citations. | `inbox_id` (required), `document_id` (required) |
| `download_document` | Download the original file of one document, as base64 in content with its file_name and content_type. A file that is no longer stored returns 410. | `inbox_id` (required), `document_id` (required) |
| `delete_document` | Delete one document with its file, its values and its webhook call log. This cannot be undone. A document still queued or being read is refused (409); try again when it has finished. | `inbox_id` (required), `document_id` (required) |
| `export_inbox` | Download an inbox's parsed documents as one Excel (xlsx), CSV or JSON file, as the console's Export page does: every parsed document, or only document_ids, or all but except_ids, and optionally only some columns (field keys). Returns the file as base64 in content with its file_name and content_type. | `inbox_id` (required), `format` (required), `document_ids`, `except_ids`, `columns` |

## Messages

**tools/call**

```text
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "parse_document",
    "arguments": {
      "file_base64": "<base64 PDF, PNG, or JPEG>",
      "schema": "invoice"
    }
  }
}
```

**Result**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"status\":\"ok\",\"credits_used\":1,\"credits_remaining\":59,\"values\":{\"vendor\":\"Northwind Supply\",\"invoiceNumber\":\"INV-1042\",\"issued\":\"2026-10-25\",\"total\":1280.5,\"currency\":\"USD\",\"lineItems\":[{\"description\":\"Cable\",\"amount\":1280.5}]}}"
      }
    ],
    "isError": false
  }
}
```

**Initialize**

```text
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": {
      "tools": {
        "listChanged": false
      }
    },
    "serverInfo": {
      "name": "doxtract",
      "version": "0.1.0"
    }
  }
}
```

**JSON-RPC error**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "Unexpected key: extra"
  }
}
```

## Errors

| Case | Response |
| --- | --- |
| Unknown tool, unexpected key or missing key | HTTP 200, JSON-RPC error -32602 |
| The operation ran and failed | HTTP 200, `isError` true, `result.content[0].text` is the REST error JSON |
| No valid key on a method that needs one | HTTP 401, JSON-RPC error -32001 |
| Any method other than POST | HTTP 405 |
| Notification with no id | HTTP 202, empty body |
