Use Deskew from your agent (MCP)
Deskew ships an MCP server, so an assistant that already has a document in front of it can extract it, run an extractor or judge a packet without you leaving the conversation. Package: @deskew/mcp. Source: Metricall-AI-Lab/deskew-sdks.
There are two ways to run it. Pick by where your documents are.
| Local server (stdio) | Hosted server (Streamable HTTP) | |
|---|---|---|
| Runs | on your machine, started by the client | at https://mcp.deskew.dev/mcp |
| Can read | file paths, URLs, inline content | URLs and inline (base64) content only |
| Auth | DESKEW_API_KEY in the client config |
OAuth sign-in from the client, or an API key as a Bearer header |
| Best for | Claude Desktop, Claude Code, Cursor, Windsurf, VS Code: anything that works on files | claude.ai and ChatGPT connectors, hosted agents, anything without a local process |
Both expose the same tools and talk to the same API with the same credits, scopes, rate limits and request logs.
Connect a client
Section titled “Connect a client”- Open Settings → Connectors → Add custom connector.
- Name it Deskew and paste
https://mcp.deskew.dev/mcp. - Click Connect. You are sent to the Deskew dashboard to sign in, pick a project and a mode (live or test), and approve.
- Back in Claude, enable the connector in a chat. Ask: “Extract the total and admission date from this bill” with the PDF attached, or paste a URL.
Claude receives an API key named MCP · Claude for the project you chose. It is listed under API keys and can be revoked there at any time.
- Open Settings → Connectors (Developer mode must be on for custom connectors) and choose Create.
- Enter
https://mcp.deskew.dev/mcpas the MCP server URL and OAuth as authentication; leave client id and secret empty, ChatGPT registers itself. - Complete the Deskew sign-in and consent.
- In a chat, enable the Deskew connector and ask it to extract a document by URL or from an attachment.
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
{ "mcpServers": { "deskew": { "command": "npx", "args": ["-y", "@deskew/mcp"], "env": { "DESKEW_API_KEY": "deskew_live_sk_…" } } }}Restart Claude Desktop. Because the server runs locally it can read any path you mention: “Run the hospital_bill extractor on ~/Downloads/bill.pdf”.
Local, with file access:
claude mcp add deskew -e DESKEW_API_KEY=deskew_live_sk_… -- npx -y @deskew/mcpOr the hosted server with OAuth (no key to manage):
claude mcp add --transport http deskew https://mcp.deskew.dev/mcpThen /mcp inside Claude Code shows the connection; the first call opens the consent page.
.cursor/mcp.json in the project (or the global one from Settings → MCP):
{ "mcpServers": { "deskew": { "command": "npx", "args": ["-y", "@deskew/mcp"], "env": { "DESKEW_API_KEY": "deskew_live_sk_…" } } }}For the hosted server instead: { "deskew": { "url": "https://mcp.deskew.dev/mcp" } } and complete the OAuth prompt, or add "headers": { "Authorization": "Bearer deskew_live_sk_…" }.
.vscode/mcp.json:
{ "servers": { "deskew": { "type": "stdio", "command": "npx", "args": ["-y", "@deskew/mcp"], "env": { "DESKEW_API_KEY": "${input:deskew-key}" } } }, "inputs": [{ "id": "deskew-key", "type": "promptString", "description": "Deskew API key", "password": true }]}Hosted: { "type": "http", "url": "https://mcp.deskew.dev/mcp" } and sign in when prompted.
Any client that launches stdio servers: command npx, args -y @deskew/mcp, environment DESKEW_API_KEY. Any client that speaks Streamable HTTP: https://mcp.deskew.dev/mcp with OAuth or a Bearer key. Run npx -y @deskew/mcp --help for flags.
| Tool | What it does | Returns |
|---|---|---|
begin_upload |
A one-time upload URL and a ready curl command for a local file, so the bytes never pass through the model. |
upload_id to use in the document argument of the tools below |
extract_document |
Reads a PDF, scan, photo, spreadsheet, Office file or email. Options: output (markdown, text, json), tables, handwriting, language, timeout_s, offset, max_chars. |
The text (paged), plus job_id, pages, credits |
run_extractor |
Runs a published extractor (name, name@3, name@draft) on a document. include_evidence adds page, box and source text per field. |
data, flags, document check, status |
list_extractors / get_extractor |
What exists in the project, and a full definition. | Names, versions, fields, rules |
suggest_extractor |
Drafts an extractor definition from a sample document. | A definition to review and create |
create_extractor |
Creates a draft extractor from a starter (from_starter) or a definition. Asks for permission; needs extractors:write. |
The draft, runnable as name@draft |
publish_extractor |
Publishes the draft as the next version. Refused on failing tests unless force. Needs extractors:write. |
The version number and test summary |
create_packet / get_packet |
Several documents routed to extractors with cross-document rules. | Status, roles, per-role data, flags |
get_job |
A background job by id; the result when complete. | Status and progress, or the result |
list_starters |
Ready-made extractors and packet definitions. | Ids and titles |
Resources: deskew://extractors/{name} (a definition as JSON) and deskew://docs/llms (this product in plain text). Prompts: extract-fields and reconcile-claim.
How a document is passed
Section titled “How a document is passed”Every document argument takes exactly one of:
upload_id: frombegin_upload, after thecurlhas run. The right choice for a local file on the hosted server, any size.path: a file on the machine running the server. Local server only; the hosted server refuses paths so it can never read its own disk.url: anhttp(s)URL that Deskew fetches (through the same SSRF guard as the API).content_base64withfilename: bytes the agent already holds. Only for small files (about 200 KB or less): the base64 has to pass through the model as tool-call text, which is slow and capped.
Long documents and slow jobs
Section titled “Long documents and slow jobs”A result longer than max_chars (default 60,000 characters) is cut and the tool says so: truncated: true and a next_offset to pass as offset on the next call. A job that is still running after timeout_s (default 120 s, up to 600) comes back as a job id; get_job collects it later. Nothing is lost either way.
Errors
Section titled “Errors”Every API error becomes a readable tool error with the Deskew code and a link into Errors: a missing scope, an exhausted allowance (quota_exceeded), a rate limit, a rejected document. The agent sees the message and can act on it.
Authentication
Section titled “Authentication”API key. The local server reads DESKEW_API_KEY. The hosted server accepts the same key as Authorization: Bearer …. Scopes and the live/test mode of the key apply as usual.
OAuth. claude.ai, ChatGPT and other remote clients cannot hold your key, so the hosted server implements OAuth 2.1 with PKCE and dynamic client registration. The client registers itself, sends you to app.deskew.dev/connect, you sign in and choose a project and mode, and the token the client receives is a freshly minted API key named after the app (MCP · Claude). That key is visible under API keys, carries only the scopes you approved (extract:write, jobs:read, extractors:read, and extractors:write for creating and publishing extractors; the consent page lists what the app asked for), and revoking it disconnects the app. A connection made before a scope was offered will not have it: disconnect and reconnect to approve the new list. Endpoints are listed in the OAuth reference.
Only organization owners and admins can connect an app, and live mode needs a verified email, the same rules as creating a key by hand.
Limits
Section titled “Limits”- Local files up to 50 MB; inline content up to 20 MB; URLs follow the API limits (20 MB sync, 500 MB async).
- Packets take up to 40 documents per call, as files (path or content), not URLs.
- The hosted server is stateless: each request carries its own token; nothing is stored there.
- Credits, rate limits and the monthly allowance are those of the key or project, exactly as with the API.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause and fix |
|---|---|
| Client says the server exited or no tools appear | DESKEW_API_KEY missing; the server logs no API key to stderr. Set it in the client config. |
This is the hosted Deskew server; it has no access to your disk |
You passed a path to the hosted server. Use begin_upload + curl and upload_id, a URL, or the local server. |
| A tool call sits for minutes with nothing in the dashboard | The agent is typing a large content_base64 argument and has not sent the request yet. Stop it and use begin_upload. |
| Consent page says the request expired | The link is valid for 10 minutes. Start the connection again from the client. |
Tools answer insufficient_scope |
The key or consent lacks a scope. Reconnect, or create a key with the scope you need. |
| Claude or ChatGPT asks to reconnect | The key was revoked or expired. Reconnecting mints a new one. |
Run npx -y @deskew/mcp --http --port 8787 to host it yourself; set DESKEW_MCP_PUBLIC_URL to your public origin so the OAuth metadata points at the right place.