@talonic/mcp 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -3
- package/README.md +164 -168
- package/dist/content.js +12 -12
- package/dist/content.js.map +1 -1
- package/dist/http-server.js +1 -1
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,15 +7,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
_No unreleased changes._
|
|
11
|
+
|
|
12
|
+
## [0.1.52] - 2026-06-01
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **ChatGPT Apps SDK widget** (`src/widgets/`) now reads tool output via `window.openai` and declares a Content-Security-Policy, fixing the extraction-result card rendering inside ChatGPT's iframe sandbox.
|
|
17
|
+
|
|
18
|
+
## [0.1.51] - 2026-06-01
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`docs/architecture/docs-pipeline.md`** — canonical reference for the repo's two parallel docs surfaces (`src/content/sections/*.ts` → `/docs/mcp/*` vs `docs/sections.json` → `/docs/{sdk,api,platform}/*`), the four-file checklist for adding a tool, the failure-mode table, and the CI-token map. Agent-discovery surfaces (`AGENTS.md`, `CLAUDE.md`) point here.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `talonic_list_schemas` now returns **compact summaries** (id, short_id, name, description, version, field count) and drops the heavy full `definition` blob from the list response. Fetch a single schema's definition on demand instead of paying for every definition on every list call.
|
|
27
|
+
|
|
28
|
+
## [0.1.50] - 2026-05-31
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Closed the **MCP-docs gap on talonic.com**: `talonic_get_balance` and `talonic_request_upload` were missing from the MCP docs navigation, and the `dataType` / preventive-reactive filter guidance had not propagated to `talonic.com/docs/mcp/*`. Added the nav entries and content so the published MCP docs match the shipped tool surface.
|
|
33
|
+
|
|
34
|
+
## [0.1.49] - 2026-05-28
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **`talonic_get_document` output validation on pre-extraction documents.** A freshly created browser-handoff document returns `null` for `source.id`, `source.type`, and several `triage` fields until ingest completes. The Zod outputSchema used `.optional()` (accepts `undefined`, not `null`), so hosted clients rejected the response with a `-32602` output-validation error mid-poll. Those fields are now `.nullable().optional()`, so an agent can poll the document immediately after `talonic_request_upload` without tripping validation.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **`talonic_request_upload` polling guidance hardened.** The description now states explicitly that a user message like "done" or "uploaded" confirms only the browser-side upload — the agent must still poll `talonic_get_document` until `status` is `completed` before calling `talonic_extract`. `talonic_get_document`'s description documents the full lifecycle (`pending_upload → queued → extracting → completed`).
|
|
43
|
+
|
|
44
|
+
## [0.1.47] - 2026-05-28
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **Aligned the browser-handoff poll target with the platform fix.** After the platform began enqueuing extraction on upload, the happy-path lifecycle became `pending_upload → queued → extracting → completed` and no longer surfaces `uploaded` in normal operation. `talonic_request_upload` and `talonic_get_document` descriptions now tell agents to poll for `completed`. Added unit tests for `talonic_request_upload` (happy path, custom base URL, per-call token refresh, non-2xx and network-error paths).
|
|
49
|
+
|
|
50
|
+
## [0.1.46] - 2026-05-27
|
|
51
|
+
|
|
10
52
|
### Added
|
|
11
53
|
|
|
12
|
-
-
|
|
54
|
+
- **`talonic_request_upload` — browser-handoff upload for hosted AI agents.** A new tool that routes file delivery around two structural limits of hosted connectors (Claude.ai web, ChatGPT): the ~32 KB tool-call argument cap and the sandbox egress allowlist. It returns a pre-allocated `document_id`, a browser-openable `upload_url` (`https://app.talonic.com/u/<token>`), and an `expires_at`. The user opens the link and drops the file; the agent polls `talonic_get_document` until `status === "completed"`, then calls `talonic_extract` with the `document_id`. Tool count: 8 → 9. `talonic_extract`'s description gained a "large files / hosted environments" note pointing at the new flow. Verified end-to-end against production Claude.ai.
|
|
55
|
+
|
|
56
|
+
## [0.1.45] - 2026-05-20
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **ChatGPT Apps SDK widget for `talonic_extract`.** New extraction-result widget (`ui://widget/extraction-result.html`, `src/widgets/`) registered as an MCP resource with MIME `text/html;profile=mcp-app`. `talonic_extract` declares `_meta["openai/outputTemplate"]` pointing at it, so ChatGPT renders extraction results as an inline card: document metadata, extracted fields, overall + per-field confidence bars, and copy/download-JSON controls. Pure HTML+CSS+vanilla-JS embedded as a string — no bundler, no new runtime dependencies. Render-only; no secrets cross into the iframe (asserted by tests). Other MCP clients ignore the widget resource and `outputTemplate` hint — no behavior change for them.
|
|
13
61
|
- **Tool-annotation regression test** (`tests/widgets/tool-annotations.test.ts`) locking the Apps-SDK-required hint contract: five pure-lookup tools are `readOnlyHint: true`; `extract`, `save_schema`, and `to_markdown` are `readOnlyHint: false`. (`to_markdown` is intentionally not read-only — its file-input path ingests a document via extract, uploading and consuming credits.)
|
|
14
|
-
|
|
62
|
+
|
|
63
|
+
### Note
|
|
64
|
+
|
|
65
|
+
- Versions 0.1.40–0.1.44 were patch bumps from the docs-sync / dispatch-token pipeline verification burst and an env-gated debug-instrumentation pass (added in `3f7fb98`, removed in `4755142`) used to measure the Claude.ai connector argument cap. No public tool-surface changes.
|
|
66
|
+
|
|
67
|
+
## [0.1.39] - 2026-05-19
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- **`dataType` field on `talonic_search`'s outputSchema** for both `fieldMatches[]` and `fields[]` (`src/tools/search.ts`). Mirrors the API change (platform `c16f2656` + `0689c1b2`) that added `dataType` to the omnisearch response. The MCP outputSchema previously did not declare it, so Zod's strip mode would have dropped it from `structuredContent`. Field is `z.string().nullable().optional()` — accepts `"string"`, `"number"`, `"array"`, plus `null` for non-materialized entries, plus absent for older deploys.
|
|
15
72
|
|
|
16
73
|
### Changed
|
|
17
74
|
|
|
18
|
-
- `talonic_filter` SCHEMA TYPING block restructured into a **preventive / reactive** pair: agents
|
|
75
|
+
- `talonic_filter` SCHEMA TYPING block restructured into a **preventive / reactive** pair: agents call `talonic_search` first and gate numeric operators (`gt`/`gte`/`lt`/`lte`/`between`) on `field.dataType === "number"` before constructing the filter, with the API's `warnings[]` array remaining the reactive safety net. Closes the schema-typing footgun end-to-end.
|
|
19
76
|
|
|
20
77
|
## [0.1.38] - 2026-05-18
|
|
21
78
|
|
package/README.md
CHANGED
|
@@ -1,60 +1,75 @@
|
|
|
1
1
|
# @talonic/mcp
|
|
2
2
|
|
|
3
|
-
Official Talonic MCP server
|
|
3
|
+
**Official Talonic MCP server.** Give any AI agent the ability to extract structured, schema-validated data from any document — PDFs, scans, invoices, contracts, forms — via the [Model Context Protocol](https://modelcontextprotocol.io).
|
|
4
4
|
|
|
5
5
|
[](https://glama.ai/mcp/servers/talonicdev/talonic-mcp)
|
|
6
6
|
[](https://smithery.ai/servers/talonic/talonic)
|
|
7
7
|
|
|
8
|
-
> **Status:**
|
|
8
|
+
> **Status:** stable, listed on the [official MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.talonicdev/talonic-mcp`. **Nine tools and two resources**, verified end-to-end against production (including the Claude.ai hosted connector). Runs as a local stdio process for desktop/IDE clients and as a hosted Streamable HTTP server at `mcp.talonic.com` for Claude.ai connectors.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
---
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- [**Smithery**](https://smithery.ai/servers/talonic/talonic) MCP marketplace.
|
|
14
|
-
- [**Official MCP Registry**](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.talonicdev/talonic-mcp) as `io.github.talonicdev/talonic-mcp`.
|
|
15
|
-
- [**mcp.so**](https://mcp.so/server/talonic-mcp) directory.
|
|
16
|
-
- [**Glama**](https://glama.ai/mcp/servers/talonicdev/talonic-mcp) MCP server catalogue.
|
|
17
|
-
- [**Python SDK (`talonic`)**](https://github.com/talonicdev/talonic-python) on PyPI — direct API client, sync + async.
|
|
12
|
+
## What you get
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
One install gives an agent the whole document-extraction workflow:
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
| Tool | What it does |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| **`talonic_extract`** | Extract schema-validated JSON from a document, with per-field confidence scores. The primary tool. |
|
|
19
|
+
| **`talonic_request_upload`** | Get a browser upload link for files too large to pass through a hosted connector (e.g. Claude.ai). The robust path for real-world documents. |
|
|
20
|
+
| **`talonic_to_markdown`** | OCR a document to clean markdown. |
|
|
21
|
+
| **`talonic_search`** | Omnisearch across documents, fields, sources, and schemas. |
|
|
22
|
+
| **`talonic_filter`** | Filter documents by extracted field values (`eq`, `gt`, `between`, `contains`, …). |
|
|
23
|
+
| **`talonic_get_document`** | Fetch a document's metadata, processing status, and links. |
|
|
24
|
+
| **`talonic_list_schemas`** | List saved schemas (with definitions). |
|
|
25
|
+
| **`talonic_save_schema`** | Save a reusable schema to the workspace. |
|
|
26
|
+
| **`talonic_get_balance`** | Read credit balance, EUR value, burn rate, and runway for budget-aware behaviour. |
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
Plus two resources for clients that browse them (Claude Desktop, Cowork render these in-UI):
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
- **`talonic://schemas`** — the saved-schemas list.
|
|
31
|
+
- **`talonic://webhooks/reference`** — webhook event types, delivery semantics, signature verification, and retry policy.
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
Every tool description is written for an LLM, with explicit **USE WHEN / DO NOT USE WHEN** guidance, so agents pick the right tool without extra prompting.
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
2. Settings → API Keys → Create New Key.
|
|
31
|
-
3. Copy the `tlnc_` value into your MCP client config (snippets below).
|
|
35
|
+
## Why use it
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
When an agent needs structured data out of a PDF, scan, or messy document, the usual approach is raw OCR plus an LLM call — and the results drift: tables get mangled, dates get misread, totals come out wrong. `talonic_extract` instead returns **schema-validated JSON with per-field confidence scores**, a detected document type, and stable IDs for follow-up calls. The full pipeline (upload → OCR → extraction → validation) runs server-side in one request.
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
---
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
### 1. Get an API key (30 seconds)
|
|
44
|
+
|
|
45
|
+
Each user runs against their own isolated Talonic workspace — your documents and schemas are private to you.
|
|
46
|
+
|
|
47
|
+
1. Sign up at **[app.talonic.com](https://app.talonic.com)** — free tier, 50 extractions/day, no credit card.
|
|
48
|
+
2. Settings → API Keys → **Create New Key**.
|
|
49
|
+
3. Copy the `tlnc_…` value into your MCP client config (snippets below).
|
|
50
|
+
|
|
51
|
+
> **You don't need an API key for Claude.ai.** The hosted connector uses [OAuth](#claudeai-hosted-connector) — Claude.ai handles auth via PKCE and stores its own short-lived tokens. The API key is only needed for **local-stdio installs** (Claude Desktop, Cursor, Cline, Continue, Cowork) and the API-key URL fallback.
|
|
52
|
+
|
|
53
|
+
### 2. Install
|
|
54
|
+
|
|
55
|
+
Every local client launches the server the same way — a one-line `npx` invocation with your key in the `env` block. No clone, no build:
|
|
38
56
|
|
|
39
57
|
```jsonc
|
|
40
58
|
{
|
|
41
59
|
"command": "npx",
|
|
42
60
|
"args": ["-y", "@talonic/mcp@latest"],
|
|
43
|
-
"env": { "TALONIC_API_KEY": "tlnc_..." }
|
|
61
|
+
"env": { "TALONIC_API_KEY": "tlnc_..." }
|
|
44
62
|
}
|
|
45
63
|
```
|
|
46
64
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
**Version pinning.** `@latest` is fine for trying things out and for personal use. For production deployments and CI, pin to a specific version (e.g. `@talonic/mcp@0.1.35`) so a future release cannot silently change tool descriptions, validation rules, or the response shape your agent depends on. Bump the pin manually after reviewing the CHANGELOG.
|
|
50
|
-
|
|
51
|
-
Talonic uses a single API key per workspace. The same key authorises all tools. There is no scoping mechanism in v0.1; treat the key like any other secret and store it in your client's secret store rather than in version control.
|
|
65
|
+
**Version pinning.** `@latest` is fine for trying things out. For production and CI, pin a version (e.g. `@talonic/mcp@0.1.52`) so a release can't silently change tool descriptions, validation rules, or response shapes your agent depends on. Bump the pin after reviewing the [CHANGELOG](CHANGELOG.md).
|
|
52
66
|
|
|
53
|
-
|
|
67
|
+
---
|
|
54
68
|
|
|
55
|
-
##
|
|
69
|
+
## Client setup
|
|
56
70
|
|
|
57
|
-
|
|
71
|
+
<details>
|
|
72
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
58
73
|
|
|
59
74
|
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
60
75
|
|
|
@@ -64,19 +79,19 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
|
|
|
64
79
|
"talonic": {
|
|
65
80
|
"command": "npx",
|
|
66
81
|
"args": ["-y", "@talonic/mcp@latest"],
|
|
67
|
-
"env": {
|
|
68
|
-
"TALONIC_API_KEY": "tlnc_your_key_here"
|
|
69
|
-
}
|
|
82
|
+
"env": { "TALONIC_API_KEY": "tlnc_your_key_here" }
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
```
|
|
74
87
|
|
|
75
|
-
Fully restart Claude Desktop (Cmd+Q on macOS
|
|
88
|
+
Fully restart Claude Desktop (Cmd+Q on macOS — not just close the window). Talonic appears in the connected-servers list with all nine tools.
|
|
89
|
+
</details>
|
|
76
90
|
|
|
77
|
-
|
|
91
|
+
<details>
|
|
92
|
+
<summary><strong>Cursor</strong></summary>
|
|
78
93
|
|
|
79
|
-
Edit `~/.cursor/mcp.json` (or
|
|
94
|
+
Edit `~/.cursor/mcp.json` (or Cursor settings → MCP → edit config):
|
|
80
95
|
|
|
81
96
|
```json
|
|
82
97
|
{
|
|
@@ -84,192 +99,190 @@ Edit `~/.cursor/mcp.json` (or open Cursor settings → MCP → edit config):
|
|
|
84
99
|
"talonic": {
|
|
85
100
|
"command": "npx",
|
|
86
101
|
"args": ["-y", "@talonic/mcp@latest"],
|
|
87
|
-
"env": {
|
|
88
|
-
"TALONIC_API_KEY": "tlnc_your_key_here"
|
|
89
|
-
}
|
|
102
|
+
"env": { "TALONIC_API_KEY": "tlnc_your_key_here" }
|
|
90
103
|
}
|
|
91
104
|
}
|
|
92
105
|
}
|
|
93
106
|
```
|
|
107
|
+
</details>
|
|
94
108
|
|
|
95
|
-
|
|
109
|
+
<details>
|
|
110
|
+
<summary><strong>Cline (VS Code)</strong></summary>
|
|
96
111
|
|
|
97
|
-
Open the Cline panel → settings (gear
|
|
112
|
+
Open the Cline panel → settings (gear) → MCP Servers → Edit. Add the entry above. Save and restart the panel.
|
|
113
|
+
</details>
|
|
98
114
|
|
|
99
|
-
|
|
115
|
+
<details>
|
|
116
|
+
<summary><strong>Continue (VS Code / JetBrains)</strong></summary>
|
|
100
117
|
|
|
101
|
-
Edit `~/.continue/config.json
|
|
118
|
+
Edit `~/.continue/config.json`, add to the `mcpServers` array:
|
|
102
119
|
|
|
103
120
|
```json
|
|
104
121
|
{
|
|
105
122
|
"name": "talonic",
|
|
106
123
|
"command": "npx",
|
|
107
124
|
"args": ["-y", "@talonic/mcp@latest"],
|
|
108
|
-
"env": {
|
|
109
|
-
"TALONIC_API_KEY": "tlnc_your_key_here"
|
|
110
|
-
}
|
|
125
|
+
"env": { "TALONIC_API_KEY": "tlnc_your_key_here" }
|
|
111
126
|
}
|
|
112
127
|
```
|
|
128
|
+
</details>
|
|
113
129
|
|
|
114
|
-
|
|
130
|
+
<details>
|
|
131
|
+
<summary><strong>Cowork</strong></summary>
|
|
115
132
|
|
|
116
133
|
Open Cowork settings → MCP Servers → Add. Use the same shape as Claude Desktop above.
|
|
134
|
+
</details>
|
|
117
135
|
|
|
118
|
-
### Claude.ai (hosted
|
|
119
|
-
|
|
120
|
-
Claude.ai's "Add custom connector" flow uses a remote MCP URL instead of a local stdio process. We host one at `mcp.talonic.com`. Two install paths are supported. **OAuth is the recommended path** (no API key needed in the connector config); the API-key URL is kept as an alternative for users who prefer a static credential or cannot complete the consent flow.
|
|
136
|
+
### Claude.ai (hosted connector)
|
|
121
137
|
|
|
122
|
-
|
|
138
|
+
Claude.ai's "Add custom connector" flow uses a remote MCP URL instead of a local process. We host one at `mcp.talonic.com`. **OAuth is the recommended path** — no API key in the config.
|
|
123
139
|
|
|
124
|
-
|
|
125
|
-
2. Click "Add custom connector".
|
|
126
|
-
3. URL: `https://mcp.talonic.com/mcp` (no query string, no headers).
|
|
127
|
-
4. Click **Connect**.
|
|
128
|
-
5. You are redirected to Talonic. Sign in with Google, Microsoft, or your company SSO.
|
|
129
|
-
6. Approve the consent screen. The requested scopes are `extract:write`, `documents:read`, `schemas:read`. Pick a workspace if your account has multiple.
|
|
130
|
-
7. You are returned to Claude.ai. The connector is live and all eight tools appear.
|
|
140
|
+
**Recommended — OAuth (no API key):**
|
|
131
141
|
|
|
132
|
-
|
|
142
|
+
1. Open [claude.ai/settings/connectors](https://claude.ai/settings/connectors) → **Add custom connector**.
|
|
143
|
+
2. URL: `https://mcp.talonic.com/mcp` (no query string, no headers).
|
|
144
|
+
3. Click **Connect** → you're redirected to Talonic → sign in (Google, Microsoft, or SSO).
|
|
145
|
+
4. Approve the consent screen (scopes: `extract:write`, `documents:read`, `schemas:read`). Pick a workspace if you have multiple.
|
|
146
|
+
5. You're returned to Claude.ai. All nine tools appear.
|
|
133
147
|
|
|
134
|
-
|
|
148
|
+
The flow uses PKCE (RFC 7636) and dynamic client registration (RFC 7591). Claude.ai stores a 1-hour access token + 30-day refresh token and refreshes automatically. No API key ever touches the connector config or any URL. Revoke by removing the connector or revoking the OAuth client in your Talonic dashboard.
|
|
135
149
|
|
|
136
|
-
|
|
150
|
+
**Alternative — API key in URL** (firewalled environments, automation, static credential):
|
|
137
151
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Trade-offs versus OAuth: the key is persisted in Claude.ai's connector store and may appear in Anthropic-side logs and request URLs. Rotate the key in your Talonic dashboard if you remove or share the connector. The hosted MCP server forwards the key to the Talonic API exactly as it would forward an OAuth bearer; tool surface and behaviour are identical.
|
|
152
|
+
```
|
|
153
|
+
https://mcp.talonic.com/mcp?apiKey=tlnc_your_key_here
|
|
154
|
+
```
|
|
143
155
|
|
|
144
|
-
|
|
156
|
+
Trade-off: the key is persisted in Claude.ai's connector store and may appear in Anthropic-side logs. Rotate it if you remove or share the connector.
|
|
145
157
|
|
|
146
|
-
|
|
158
|
+
> **Uploading files in Claude.ai?** Use [`talonic_request_upload`](#file-uploads-the-browser-handoff-flow) — see the next section. Dragging a real file straight into the chat does **not** work through hosted connectors (a platform limit, explained below).
|
|
147
159
|
|
|
148
|
-
|
|
160
|
+
---
|
|
149
161
|
|
|
150
|
-
|
|
162
|
+
## File uploads: the browser-handoff flow
|
|
151
163
|
|
|
152
|
-
|
|
153
|
-
- **`talonic_search`**, status: stable. Omnisearch across documents, fields, sources, and schemas in the workspace. Use for conceptual or fuzzy queries.
|
|
154
|
-
- **`talonic_filter`**, status: stable. Filter documents by extracted field values using composable conditions (`eq`, `gt`, `between`, `contains`, `is_empty`, `is_not_empty`, etc.). Accepts canonical field names (e.g. `vendor.name`) which the Talonic API resolves to ids server-side, or UUIDs directly. See [Known limitations](#known-limitations-v01) for schema-type compatibility with numeric operators.
|
|
155
|
-
- **`talonic_get_document`**, status: stable. Fetch full metadata for a single document by id, including processing log and link URLs.
|
|
156
|
-
- **`talonic_to_markdown`**, status: stable. Get OCR-converted markdown for a document. Accepts `document_id` (cheapest), `file_data` + `filename`, `file_path`, or `file_url`. Returns the same `cost` block as `talonic_extract` when an extract step ran (i.e., on the file inputs); `null` on the `document_id` path.
|
|
157
|
-
- **`talonic_list_schemas`**, status: stable. List all saved schemas with their definitions. Returns both UUID and SCH-XXXXXXXX short id; either is accepted by `talonic_extract`.
|
|
158
|
-
- **`talonic_save_schema`**, status: stable. Save a schema definition to the workspace for reuse.
|
|
159
|
-
- **`talonic_get_balance`**, status: stable. Read the workspace credit balance, EUR value, 30-day burn rate, projected runway, tier, and next-tier-reset timestamp. Use it for budget-aware decisions before kicking off large batches.
|
|
164
|
+
This is the most important thing to understand about running Talonic inside a **hosted connector** (Claude.ai web, ChatGPT).
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
### The constraint
|
|
162
167
|
|
|
163
|
-
- `
|
|
164
|
-
- `talonic://webhooks/reference`: webhook event types, delivery behavior, signature verification algorithms, and retry policies. Use this when an agent needs to set up or troubleshoot a webhook integration without leaving the MCP context.
|
|
168
|
+
Hosted AI platforms cap the size of a single tool-call argument. On Claude.ai the effective ceiling is **~32 KB of decoded payload (~43 KB of base64)** — measured directly against production. A real PDF is hundreds of KB to several MB, so passing it as base64 `file_data` gets **silently truncated**: the server receives a clean-but-incomplete prefix, the API registers a stub document, and extraction returns `null` fields. The agent never sees the truncation. Separately, the agent's sandbox **cannot upload the bytes out-of-band** either — egress is allowlisted, so a direct `PUT` to storage is blocked.
|
|
165
169
|
|
|
166
|
-
|
|
170
|
+
These are deliberate, structural properties of hosted/sandboxed agent platforms — not a Talonic bug, and not something we can configure away. The same limits apply to ChatGPT connectors and similar surfaces.
|
|
167
171
|
|
|
168
|
-
|
|
172
|
+
### The solution: `talonic_request_upload`
|
|
169
173
|
|
|
170
|
-
**
|
|
174
|
+
Route the file transfer onto the **user's own browser**, which has neither the tool-call cap nor the egress allowlist:
|
|
171
175
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
```
|
|
177
|
+
1. Agent calls talonic_request_upload(filename)
|
|
178
|
+
→ { document_id, upload_url: "https://app.talonic.com/u/<token>", expires_at }
|
|
179
|
+
2. Agent shows the upload_url to the user.
|
|
180
|
+
3. User opens it in a browser tab and drops the file.
|
|
181
|
+
4. Agent polls talonic_get_document(document_id) until status === "completed".
|
|
182
|
+
5. Agent calls talonic_extract(document_id, schema) — structured data comes back.
|
|
183
|
+
```
|
|
175
184
|
|
|
176
|
-
|
|
185
|
+
Cost to the user: one click. It's the same pattern as a Slack/Stripe "open in browser" link, and it works on every hosted agent. **Verified end-to-end in production Claude.ai.**
|
|
177
186
|
|
|
178
|
-
|
|
179
|
-
- Value-based on extracted fields ("invoices over 1000 EUR"): `talonic_filter`.
|
|
180
|
-
- They reference a `document_id`: `talonic_get_document` for metadata, `talonic_to_markdown` for text, `talonic_extract` to re-extract with a new schema. Re-using a `document_id` is cheaper than re-uploading.
|
|
187
|
+
> **For the agent:** a user saying "done" or "uploaded" only confirms the *browser-side* upload finished — server-side OCR + processing take another ~10–30 s. Poll `talonic_get_document` until `status` is `"completed"` before calling `talonic_extract`. Calling early returns errors that look like the file is missing. (The tool descriptions enforce this; you generally don't need to prompt for it.)
|
|
181
188
|
|
|
182
|
-
|
|
189
|
+
### When you don't need it
|
|
183
190
|
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
- Iterate inline before saving. Avoid clutter.
|
|
191
|
+
- **Local-stdio installs** (Claude Desktop, Cursor, Cline, Continue, Cowork) have **no tool-call cap**. Drop a file in and the agent passes `file_data` directly — `talonic_request_upload` isn't needed.
|
|
192
|
+
- The file is already at a **public URL** → pass `file_url` to `talonic_extract`.
|
|
193
|
+
- The file was already uploaded at app.talonic.com → pass its `document_id`.
|
|
188
194
|
|
|
189
|
-
|
|
195
|
+
---
|
|
190
196
|
|
|
191
|
-
|
|
192
|
-
- Per-field confidence below ~0.7: mark as "needs review", do not use silently in calculations or external API calls.
|
|
193
|
-
- Critical fields (amounts, legal terms, names, dates): confirm with user before acting, even at high confidence.
|
|
194
|
-
- Per-field source provenance (page, section, source text snippet) is available by passing `include_provenance: true` on `talonic_extract`. Use it when the user wants to cite the source of a value or verify against the original document.
|
|
197
|
+
## Agent decision guide
|
|
195
198
|
|
|
196
|
-
|
|
199
|
+
Pick the right tool before calling — the wrong one returns the wrong data, costs credits, and slows the conversation.
|
|
197
200
|
|
|
198
|
-
|
|
199
|
-
- The data is already in conversation history from a previous tool call. Re-use it.
|
|
200
|
-
- The user wants to discuss or revise an extraction you already produced. Reason over the previous result instead of re-extracting.
|
|
201
|
-
- For cost or balance questions, call `talonic_get_balance` to read the workspace's credit balance, EUR value, 30-day burn rate, projected runway, tier, and next reset. Per-call cost is also surfaced on every `talonic_extract` and `talonic_to_markdown` response under the `cost` field.
|
|
201
|
+
**User has a file**
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
- Local client (Desktop, Cursor, …), small-to-medium file → `talonic_extract` with `file_data` + `filename`.
|
|
204
|
+
- Hosted connector (Claude.ai) → `talonic_request_upload`, then poll, then `talonic_extract` by `document_id`. (See [browser-handoff](#file-uploads-the-browser-handoff-flow).)
|
|
205
|
+
- File is at a public URL → `talonic_extract` with `file_url`.
|
|
206
|
+
- They want specific fields → pass a `schema` or `schema_id`. They want full text → `talonic_to_markdown`. Both → `talonic_extract` with `include_markdown: true`.
|
|
204
207
|
|
|
205
|
-
|
|
208
|
+
**User is asking about existing documents**
|
|
206
209
|
|
|
207
|
-
|
|
210
|
+
- Conceptual/fuzzy ("any docs about indemnification") → `talonic_search`.
|
|
211
|
+
- Value-based ("invoices over 1000 EUR") → `talonic_filter`.
|
|
212
|
+
- They reference a `document_id` → `talonic_get_document` (metadata), `talonic_to_markdown` (text), or `talonic_extract` (re-extract with a new schema). Re-using a `document_id` is cheaper than re-uploading.
|
|
208
213
|
|
|
209
|
-
|
|
214
|
+
**Working with schemas**
|
|
210
215
|
|
|
211
|
-
|
|
216
|
+
- One-off → pass the schema inline. Reused across many docs → `talonic_save_schema` once, then `talonic_extract` with `schema_id`. Discover existing → `talonic_list_schemas`.
|
|
212
217
|
|
|
213
|
-
|
|
218
|
+
**Confidence & human review**
|
|
214
219
|
|
|
215
|
-
|
|
220
|
+
- `confidence.overall` < ~0.7 → tell the user the extraction may be unreliable; surface low-confidence fields; confirm before downstream actions.
|
|
221
|
+
- Per-field confidence < ~0.7 → mark "needs review"; don't use silently in calculations or external calls.
|
|
222
|
+
- Critical fields (amounts, legal terms, names, dates) → confirm with the user even at high confidence.
|
|
223
|
+
- Need to cite sources? Pass `include_provenance: true` for per-field page/section/source-text.
|
|
216
224
|
|
|
217
|
-
|
|
225
|
+
**When *not* to call Talonic**
|
|
218
226
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
- General-knowledge or chat questions — don't pre-emptively extract.
|
|
228
|
+
- The data is already in the conversation from a prior call — reuse it.
|
|
229
|
+
- For cost/balance questions → `talonic_get_balance`. Per-call cost is on every `talonic_extract` / `talonic_to_markdown` response under `cost`.
|
|
222
230
|
|
|
223
|
-
|
|
231
|
+
---
|
|
224
232
|
|
|
225
233
|
## How it works
|
|
226
234
|
|
|
227
235
|
```
|
|
228
|
-
Agent (Claude Desktop / Cursor /
|
|
229
|
-
|
|
236
|
+
Agent (Claude Desktop / Cursor / Claude.ai / …)
|
|
237
|
+
│ MCP protocol — stdio (local) or Streamable HTTP (hosted)
|
|
238
|
+
▼
|
|
230
239
|
Talonic MCP server (this package)
|
|
231
|
-
|
|
240
|
+
│ HTTPS, Bearer auth (API key or OAuth token)
|
|
241
|
+
▼
|
|
232
242
|
api.talonic.com
|
|
233
243
|
```
|
|
234
244
|
|
|
235
|
-
Each tool call is one HTTP request to the Talonic API
|
|
245
|
+
Each tool call is one HTTP request to the Talonic API. The server handles auth, retries on transient failures (429, 5xx), MIME-type detection, multipart serialisation, and structured error formatting. It is a thin, stateless client — see [Privacy](#privacy).
|
|
236
246
|
|
|
237
247
|
## Configuration
|
|
238
248
|
|
|
239
249
|
Set via the `env` block in your MCP client config:
|
|
240
250
|
|
|
241
|
-
| Variable
|
|
242
|
-
|
|
|
243
|
-
| `TALONIC_API_KEY`
|
|
244
|
-
| `TALONIC_BASE_URL` | no
|
|
251
|
+
| Variable | Required | Description |
|
|
252
|
+
| --- | --- | --- |
|
|
253
|
+
| `TALONIC_API_KEY` | yes (local installs) | Your Talonic API key. Starts with `tlnc_`. Not needed for Claude.ai OAuth. |
|
|
254
|
+
| `TALONIC_BASE_URL` | no | Override the API base URL. Default: `https://api.talonic.com`. |
|
|
255
|
+
|
|
256
|
+
---
|
|
245
257
|
|
|
246
258
|
## Troubleshooting
|
|
247
259
|
|
|
248
|
-
|
|
249
|
-
The `env` block
|
|
260
|
+
**`Error: TALONIC_API_KEY environment variable is required.`**
|
|
261
|
+
The `env` block is missing or unread. Check the JSON shape, then fully restart the client (not just the conversation).
|
|
262
|
+
|
|
263
|
+
**Talonic doesn't appear in the connected-servers list.**
|
|
264
|
+
Confirm `command` is `npx` and `args` are exactly `["-y", "@talonic/mcp@latest"]`. Sanity check in a terminal: `npx -y @talonic/mcp@latest --version` should print a version.
|
|
250
265
|
|
|
251
|
-
|
|
252
|
-
|
|
266
|
+
**`talonic_extract` returns a validation error with no schema.**
|
|
267
|
+
By design. Schema-less extraction is unreliable, so the MCP layer rejects calls missing both `schema` and `schema_id`. Provide an inline `schema` (full JSON Schema recommended) or a `schema_id` from `talonic_list_schemas`.
|
|
253
268
|
|
|
254
|
-
|
|
255
|
-
|
|
269
|
+
**Dragging a file into Claude.ai gives empty/`null` fields.**
|
|
270
|
+
The hosted-connector tool-call cap (~32 KB) truncated `file_data`. Use [`talonic_request_upload`](#file-uploads-the-browser-handoff-flow) — the browser-handoff flow is the supported path. Local-stdio installs are unaffected.
|
|
256
271
|
|
|
257
|
-
**`talonic_extract`
|
|
258
|
-
|
|
272
|
+
**`talonic_request_upload` worked but `talonic_extract` errors right after.**
|
|
273
|
+
You extracted before processing finished. Poll `talonic_get_document` until `status === "completed"`, then extract. A user's "done" only means the browser upload landed, not that OCR is done.
|
|
259
274
|
|
|
260
|
-
**`talonic_filter` returns
|
|
261
|
-
Two
|
|
275
|
+
**`talonic_filter` returns nothing when you expect data.**
|
|
276
|
+
Two causes: (1) the field isn't extracted/filterable yet — call `talonic_search` and check `filterable: true`; (2) schema-typing — numeric operators (`gt`, `gte`, `lt`, `lte`, `between`) need the field typed as `number`. A `string` field holding numeric content silently returns zero. Gate on `field.dataType === "number"` (from `talonic_search`) before constructing numeric filters.
|
|
262
277
|
|
|
263
|
-
|
|
264
|
-
|
|
278
|
+
**Tool descriptions look stale after an update.**
|
|
279
|
+
Some clients cache tool lists. For Claude.ai, remove and re-add the connector. For local clients, restart.
|
|
265
280
|
|
|
266
|
-
|
|
267
|
-
Some MCP clients cache tool descriptions. Restart the client after a server update.
|
|
281
|
+
---
|
|
268
282
|
|
|
269
283
|
## Known limitations (v0.1)
|
|
270
284
|
|
|
271
|
-
- **Schema is required on `talonic_extract`.** Schema-less extraction is
|
|
272
|
-
- **Schema definition: prefer full JSON Schema.** The flat key-type map (`{ vendor_name: "string", ... }`) is documented as accepted, but if you get a "no fields" error from the API, fall back to:
|
|
285
|
+
- **Schema is required on `talonic_extract`.** Schema-less extraction is rejected at the MCP layer. Pass a `schema` (full JSON Schema recommended) or `schema_id`. If a flat key-type map (`{ vendor_name: "string" }`) yields a "no fields" error, use full JSON Schema:
|
|
273
286
|
```json
|
|
274
287
|
{
|
|
275
288
|
"type": "object",
|
|
@@ -280,21 +293,12 @@ Some MCP clients cache tool descriptions. Restart the client after a server upda
|
|
|
280
293
|
"required": ["vendor_name", "total_amount"]
|
|
281
294
|
}
|
|
282
295
|
```
|
|
283
|
-
- **
|
|
284
|
-
- **
|
|
285
|
-
-
|
|
286
|
-
- **
|
|
287
|
-
- **Per-call cost surfacing is extract-only.** `talonic_extract` and `talonic_to_markdown` (when an extract step runs) return a `cost` block (`costCredits`, `costEur`, `balanceCredits`, `cellsResolvedRegistry`, `cellsResolvedAi`) parsed from the API's `X-Talonic-Cost-*` response headers. Read endpoints (`talonic_search`, `talonic_filter`, `talonic_get_document`, `talonic_list_schemas`) do not consume credits and therefore do not carry a `cost` block; `talonic_to_markdown` on the `document_id` path returns `cost: null` because no extract step ran. To read the workspace credit balance directly at any time, call `talonic_get_balance`.
|
|
288
|
-
|
|
289
|
-
## Upgrading from 0.1.0 / 0.1.1 / 0.1.2
|
|
296
|
+
- **Hosted-connector tool-call cap (~32 KB).** Real files can't pass through `file_data` on Claude.ai/ChatGPT — use [`talonic_request_upload`](#file-uploads-the-browser-handoff-flow). Local installs are unaffected.
|
|
297
|
+
- **Filter requires `filterable: true` fields.** Call `talonic_search` first; only entries with `filterable: true` are usable on `talonic_filter`.
|
|
298
|
+
- **Numeric filter operators need `number`-typed fields.** Numbers stored as strings (currency symbols, locale formatting) silently return zero. Type schema fields appropriately at design time; gate on `dataType` at query time.
|
|
299
|
+
- **Per-call cost is extract-only.** `talonic_extract` and `talonic_to_markdown` (file-input path) return a `cost` block (`costCredits`, `costEur`, `balanceCredits`, `cellsResolvedRegistry`, `cellsResolvedAi`) from the API's `X-Talonic-Cost-*` headers. Read tools don't consume credits and carry no `cost`; `talonic_to_markdown` on the `document_id` path returns `cost: null`. For balance any time → `talonic_get_balance`.
|
|
290
300
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
The fix is to point your `args` at `@latest` (or `@0.1.3` explicitly) and fully restart the client:
|
|
294
|
-
|
|
295
|
-
```jsonc
|
|
296
|
-
"args": ["-y", "@talonic/mcp@latest"]
|
|
297
|
-
```
|
|
301
|
+
---
|
|
298
302
|
|
|
299
303
|
## Develop
|
|
300
304
|
|
|
@@ -307,22 +311,14 @@ npm test
|
|
|
307
311
|
node dist/server.js --version
|
|
308
312
|
```
|
|
309
313
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
This MCP server is a thin client. It does not collect, store, log, or transmit any data on its own. Every tool call is forwarded directly to the Talonic API at `api.talonic.com` using your `TALONIC_API_KEY`, and the API response is returned verbatim to the MCP client.
|
|
313
|
-
|
|
314
|
-
The server does not:
|
|
315
|
-
|
|
316
|
-
- Persist API keys, tool inputs, tool outputs, document contents, extracted data, or any other information beyond the lifetime of a single tool call.
|
|
317
|
-
- Send analytics, telemetry, crash reports, or usage metrics to Talonic, Anthropic, or any third party.
|
|
318
|
-
- Read or write files on your machine other than the file paths you explicitly pass to `talonic_extract` / `talonic_to_markdown` (`file_path`), and only for the duration of that call.
|
|
314
|
+
Contributing to docs or adding a tool? Read [`AGENTS.md`](AGENTS.md) and [`docs/architecture/docs-pipeline.md`](docs/architecture/docs-pipeline.md) first — there are two parallel docs surfaces and it's easy to edit the wrong one.
|
|
319
315
|
|
|
320
|
-
|
|
316
|
+
## Privacy
|
|
321
317
|
|
|
322
|
-
|
|
318
|
+
This MCP server is a thin client. It does **not** collect, store, log, or transmit any data on its own. Every tool call is forwarded directly to `api.talonic.com` using your credential, and the response is returned verbatim. The server does not persist API keys, inputs, outputs, or document contents beyond a single tool call; sends no analytics or telemetry; and reads/writes files only at the `file_path` you explicitly pass, only for that call's duration.
|
|
323
319
|
|
|
324
|
-
|
|
320
|
+
What Talonic does with uploaded data is governed by [talonic.com/privacy](https://talonic.com/privacy): documents are processed for OCR + extraction, results live in your isolated workspace at app.talonic.com, and workspace data is not shared with third parties. To delete state, remove documents/schemas in the dashboard or revoke the API key. Privacy questions specific to this integration: `info@talonic.ai`.
|
|
325
321
|
|
|
326
322
|
## License
|
|
327
323
|
|
|
328
|
-
MIT
|
|
324
|
+
MIT © Talonic GmbH
|