parseur-py 1.6.0__tar.gz → 1.7.0__tar.gz

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.
Files changed (40) hide show
  1. {parseur_py-1.6.0/parseur_py.egg-info → parseur_py-1.7.0}/PKG-INFO +2 -134
  2. {parseur_py-1.6.0 → parseur_py-1.7.0}/README.md +1 -130
  3. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/cli.py +0 -24
  4. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/document.py +3 -4
  5. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/paserfield.py +6 -9
  6. {parseur_py-1.6.0 → parseur_py-1.7.0/parseur_py.egg-info}/PKG-INFO +2 -134
  7. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur_py.egg-info/SOURCES.txt +0 -3
  8. parseur_py-1.7.0/parseur_py.egg-info/entry_points.txt +2 -0
  9. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur_py.egg-info/requires.txt +0 -4
  10. {parseur_py-1.6.0 → parseur_py-1.7.0}/pyproject.toml +1 -11
  11. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_parser_field.py +77 -9
  12. parseur_py-1.6.0/parseur/mcp_server.py +0 -1327
  13. parseur_py-1.6.0/parseur_py.egg-info/entry_points.txt +0 -4
  14. parseur_py-1.6.0/tests/test_mcp_server.py +0 -143
  15. {parseur_py-1.6.0 → parseur_py-1.7.0}/LICENSE +0 -0
  16. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/__init__.py +0 -0
  17. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/client.py +0 -0
  18. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/config.py +0 -0
  19. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/decorator.py +0 -0
  20. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/event.py +0 -0
  21. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/export_config.py +0 -0
  22. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/mailbox.py +0 -0
  23. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/parser_field.py +0 -0
  24. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/__init__.py +0 -0
  25. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/document.py +0 -0
  26. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/export_config.py +0 -0
  27. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/mailbox.py +0 -0
  28. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/schemas/webhook.py +0 -0
  29. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/server.py +0 -0
  30. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/utils.py +0 -0
  31. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur/webhook.py +0 -0
  32. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur_py.egg-info/dependency_links.txt +0 -0
  33. {parseur_py-1.6.0 → parseur_py-1.7.0}/parseur_py.egg-info/top_level.txt +0 -0
  34. {parseur_py-1.6.0 → parseur_py-1.7.0}/setup.cfg +0 -0
  35. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_api_key_override.py +0 -0
  36. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_cli.py +0 -0
  37. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_document.py +0 -0
  38. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_export_config.py +0 -0
  39. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_mailbox.py +0 -0
  40. {parseur_py-1.6.0 → parseur_py-1.7.0}/tests/test_webhook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parseur-py
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: A Python client for the Parseur.com API to manage mailboxes, documents, uploads, and listen for new parsing events.
5
5
  Author-email: Parseur Team <admin@parseur.com>
6
6
  Project-URL: Homepage, https://github.com/parseur/parseur-py
@@ -14,13 +14,8 @@ Requires-Dist: requests>=2.31.0
14
14
  Requires-Dist: marshmallow>=4.0.0
15
15
  Provides-Extra: listener
16
16
  Requires-Dist: Flask>=3.1.0; extra == "listener"
17
- Provides-Extra: mcp
18
- Requires-Dist: mcp>=1.18.0; extra == "mcp"
19
- Requires-Dist: pydantic>=2.0; extra == "mcp"
20
17
  Dynamic: license-file
21
18
 
22
- <!-- mcp-name: io.github.parseur/parseur-py -->
23
-
24
19
  # 🤖🧙parseur-py
25
20
 
26
21
  **parseur-py** is a modern Python client for the [Parseur](https://parseur.com) API.
@@ -47,7 +42,6 @@ Built to help you automate document parsing at scale, parseur-py makes integrati
47
42
  ✅ Manage custom webhooks for real-time events
48
43
  ✅ Listen to events in real time with a temporary webhook & tunnel
49
44
  ✅ Fully-featured **Command Line Interface (CLI)**
50
- ✅ Built-in **MCP server** to drive Parseur from AI assistants (Claude, Cursor, …)
51
45
 
52
46
  ---
53
47
 
@@ -79,12 +73,6 @@ With event listener support (Flask + localtunnel)
79
73
  pip install "parseur-py[listener]"
80
74
  ```
81
75
 
82
- With MCP server support (use Parseur from AI assistants)
83
-
84
- ```bash
85
- pip install "parseur-py[mcp]"
86
- ```
87
-
88
76
  ### Install the package from source
89
77
 
90
78
  ```bash
@@ -211,7 +199,6 @@ for a full list of available commands.
211
199
  - **create-webhook / get-webhook / list-webhooks / delete-webhook**: Create, get, list, and delete custom webhook integrations.
212
200
  - **enable-webhook / pause-webhook**: Activate or pause a webhook for a specific mailbox.
213
201
  - **listen**: Create a temporary webhook and listen to events in real time (with optional redirect & silent mode)
214
- - **mcp**: Run the Parseur MCP server so AI assistants can manage your account (requires `[mcp]`)
215
202
 
216
203
  ---
217
204
 
@@ -265,126 +252,7 @@ Your webhook endpoint will receive POST notifications with Parseur payloads, ena
265
252
 
266
253
  ## 🤖 MCP Server (AI assistants)
267
254
 
268
- **parseur-py** ships an [MCP](https://modelcontextprotocol.io) server that exposes Parseur as tools any MCP-compatible AI assistant (Claude Desktop, Cursor, Claude Code, …) can call directly — listing mailboxes, uploading documents, reading parsed results, managing webhooks, and more.
269
-
270
- ### Install
271
-
272
- The MCP server is an **optional** feature, behind the `mcp` extra (it pulls in
273
- the `mcp` SDK and `pydantic`; the base `parseur-py` install does not):
274
-
275
- ```bash
276
- pip install "parseur-py[mcp]"
277
- ```
278
-
279
- > Zero-install: if you have [`uv`](https://docs.astral.sh/uv/), you don't need to
280
- > install anything — `uvx --from "parseur-py[mcp]" parseur-py` runs the server in
281
- > a throwaway environment. This is the recommended way to wire it into an MCP
282
- > client (see below).
283
-
284
- ### Run
285
-
286
- The server speaks MCP over **stdio**. It reads your API key from
287
- `~/.parseur.conf` (run `parseur init` first) or from the `PARSEUR_API_KEY`
288
- environment variable (which takes precedence — MCP clients usually inject it).
289
-
290
- ```bash
291
- parseur mcp # via the main CLI (needs the [mcp] extra)
292
- parseur-mcp # dedicated console script
293
- python -m parseur.mcp_server # as a module
294
- uvx --from "parseur-py[mcp]" parseur-py # zero-install with uv
295
- ```
296
-
297
- ### Configure your client
298
-
299
- Add Parseur to your MCP client config. Example for **Claude Desktop**
300
- (`claude_desktop_config.json`).
301
-
302
- Zero-install with `uv` (recommended — nothing to install or keep updated):
303
-
304
- ```json
305
- {
306
- "mcpServers": {
307
- "parseur": {
308
- "command": "uvx",
309
- "args": ["--from", "parseur-py[mcp]", "parseur-py"],
310
- "env": {
311
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
312
- }
313
- }
314
- }
315
- }
316
- ```
317
-
318
- Or, if you installed `parseur-py[mcp]` yourself, point at the console script:
319
-
320
- ```json
321
- {
322
- "mcpServers": {
323
- "parseur": {
324
- "command": "parseur-mcp",
325
- "env": {
326
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
327
- }
328
- }
329
- }
330
- }
331
- ```
332
-
333
- ### Available tools
334
-
335
- Every tool carries a title, a description, per-argument descriptions, behavioral
336
- annotations (read-only / destructive / idempotent / open-world hints), and a
337
- structured JSON output schema — so the assistant understands exactly what each
338
- command does, what it expects, and what it returns. Destructive tools
339
- (`delete_*`) are flagged so clients can ask for confirmation first.
340
-
341
- The server exposes the full client surface as **54 MCP tools**:
342
-
343
- - **Mailboxes**: `list_mailboxes`, `get_mailbox`, `get_mailbox_schema`, `create_mailbox`, `delete_mailbox`
344
- - **Mailbox settings** (one tool per setting, instead of a generic update): `rename_mailbox`, `set_ai_engine`, `set_ai_instructions`, `set_email_processing`, `set_metadata`, `set_timezone`, `set_date_format`, `set_decimal_separator`, `set_allowed_extensions`, `set_sender_filter`, `split_by_ai`, `split_by_page`, `split_by_page_range`, `split_by_keywords`, `process_page_range`, `process_odd_pages`, `process_even_pages`
345
- - **Parser fields**: `list_parser_fields`, `add_parser_field`, `update_parser_field`, `delete_parser_field`
346
- - **Documents**: `list_documents`, `get_document`, `get_document_logs`, `reprocess_document`, `skip_document`, `copy_document`, `split_document`, `reverse_split_document`, `delete_document`
347
- - **Uploads**: `upload_file`, `upload_text` (asynchronous) and `upload_file_and_wait`, `upload_text_and_wait`, `wait_for_document` (block until parsed)
348
- - **Webhooks**: `list_webhooks`, `get_webhook`, `create_webhook`, `delete_webhook`, `enable_webhook`, `pause_webhook`
349
- - **Exports**: `get_mailbox_export`, `get_table_export`, `list_export_fields`, `list_export_configs`, `get_export_config`, `create_export_config`, `update_export_config`, `delete_export_config`
350
-
351
- > **Uploading files over MCP:** `upload_file` takes a **file path** and the server reads it directly — just give the absolute path, no base64. When the desktop app launches the server locally (the usual setup) it runs on your machine, so it can read your files; no extra permission/config is needed (this server is not sandboxed to specific folders). To copy a document that is already in another mailbox, use `copy_document` instead — no file transfer at all.
352
-
353
- > **Getting results out as a file:** three kinds of export, each returning ready-to-use, self-authenticating `csv` / `json` / `xlsx` download links you can hand to the user. `get_mailbox_export` exports the whole mailbox (one row per document); `get_table_export` exports a single table field's rows (one row per line item); for a custom column selection, build an export config with `list_export_fields` + `create_export_config`.
354
-
355
- ### Workflow
356
-
357
- The tools follow the lifecycle of a mailbox — the server ships these same instructions so the assistant can follow the flow on its own:
358
-
359
- 1. **Create a mailbox** with just a title (`create_mailbox`). Don't define fields up front: Parseur auto-detects them from the first documents during its identification phase. Adjust them afterwards with `add_parser_field` / `update_parser_field` / `delete_parser_field`.
360
- 2. **Send documents** to parse with `upload_file` (a path on the server's machine) or `upload_text` (email/HTML content).
361
- 3. **Wait for the result.** Parsing is asynchronous: a document is pending while its status is `INCOMING` / `ANALYZING` / `PROGRESS` and finished at `PARSEDOK` (or `PARSEDKO` / `EXPORTKO`). The parsed data is in the document's `result` field, populated only once it reaches `PARSEDOK`. Prefer `upload_file_and_wait` / `upload_text_and_wait` to get it in one call, or `wait_for_document` to wait on an existing document.
362
- 4. **Get the data out** as a file via the three exports above, or push each parsed document to a URL in real time with `create_webhook`.
363
-
364
- IDs follow a simple convention: mailboxes and webhooks use an integer id, documents a string id, parser/table fields a `PF...` string id, and export configs an integer id.
365
-
366
- ### Publishing to the MCP Registry
367
-
368
- The server is described by [`server.json`](server.json) and can be published to the official [MCP Registry](https://registry.modelcontextprotocol.io) under the `io.github.parseur/parseur-py` name. Ownership is verified through the GitHub `parseur` organization and the `<!-- mcp-name: io.github.parseur/parseur-py -->` marker shipped in this README (so it is present in the PyPI package).
369
-
370
- ```bash
371
- # 1. Install the publisher CLI
372
- curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
373
-
374
- # 2. Authenticate (opens GitHub; you must be a member of the `parseur` org)
375
- ./mcp-publisher login github
376
-
377
- # 3. Publish the version described in server.json
378
- ./mcp-publisher publish
379
- ```
380
-
381
- Before publishing, make sure the version in `server.json` (both the top-level `version` and `packages[].version`) matches a release of `parseur-py` already on PyPI whose README contains the `mcp-name` marker. A GitHub Actions workflow (`.github/workflows/publish-mcp-registry.yml`) does this automatically on each GitHub release using GitHub OIDC.
382
-
383
- Once published, clients install and run the server with:
384
-
385
- ```bash
386
- uvx --from "parseur-py[mcp]" parseur-py
387
- ```
255
+ Parseur hosts an [MCP](https://modelcontextprotocol.io) server at `https://api.parseur.com/mcp`. Add this URL to any MCP-compatible AI assistant (Claude, Codex, Cursor, …) to drive Parseur from it. No local install is needed.
388
256
 
389
257
  ---
390
258
 
@@ -1,5 +1,3 @@
1
- <!-- mcp-name: io.github.parseur/parseur-py -->
2
-
3
1
  # 🤖🧙parseur-py
4
2
 
5
3
  **parseur-py** is a modern Python client for the [Parseur](https://parseur.com) API.
@@ -26,7 +24,6 @@ Built to help you automate document parsing at scale, parseur-py makes integrati
26
24
  ✅ Manage custom webhooks for real-time events
27
25
  ✅ Listen to events in real time with a temporary webhook & tunnel
28
26
  ✅ Fully-featured **Command Line Interface (CLI)**
29
- ✅ Built-in **MCP server** to drive Parseur from AI assistants (Claude, Cursor, …)
30
27
 
31
28
  ---
32
29
 
@@ -58,12 +55,6 @@ With event listener support (Flask + localtunnel)
58
55
  pip install "parseur-py[listener]"
59
56
  ```
60
57
 
61
- With MCP server support (use Parseur from AI assistants)
62
-
63
- ```bash
64
- pip install "parseur-py[mcp]"
65
- ```
66
-
67
58
  ### Install the package from source
68
59
 
69
60
  ```bash
@@ -190,7 +181,6 @@ for a full list of available commands.
190
181
  - **create-webhook / get-webhook / list-webhooks / delete-webhook**: Create, get, list, and delete custom webhook integrations.
191
182
  - **enable-webhook / pause-webhook**: Activate or pause a webhook for a specific mailbox.
192
183
  - **listen**: Create a temporary webhook and listen to events in real time (with optional redirect & silent mode)
193
- - **mcp**: Run the Parseur MCP server so AI assistants can manage your account (requires `[mcp]`)
194
184
 
195
185
  ---
196
186
 
@@ -244,126 +234,7 @@ Your webhook endpoint will receive POST notifications with Parseur payloads, ena
244
234
 
245
235
  ## 🤖 MCP Server (AI assistants)
246
236
 
247
- **parseur-py** ships an [MCP](https://modelcontextprotocol.io) server that exposes Parseur as tools any MCP-compatible AI assistant (Claude Desktop, Cursor, Claude Code, …) can call directly — listing mailboxes, uploading documents, reading parsed results, managing webhooks, and more.
248
-
249
- ### Install
250
-
251
- The MCP server is an **optional** feature, behind the `mcp` extra (it pulls in
252
- the `mcp` SDK and `pydantic`; the base `parseur-py` install does not):
253
-
254
- ```bash
255
- pip install "parseur-py[mcp]"
256
- ```
257
-
258
- > Zero-install: if you have [`uv`](https://docs.astral.sh/uv/), you don't need to
259
- > install anything — `uvx --from "parseur-py[mcp]" parseur-py` runs the server in
260
- > a throwaway environment. This is the recommended way to wire it into an MCP
261
- > client (see below).
262
-
263
- ### Run
264
-
265
- The server speaks MCP over **stdio**. It reads your API key from
266
- `~/.parseur.conf` (run `parseur init` first) or from the `PARSEUR_API_KEY`
267
- environment variable (which takes precedence — MCP clients usually inject it).
268
-
269
- ```bash
270
- parseur mcp # via the main CLI (needs the [mcp] extra)
271
- parseur-mcp # dedicated console script
272
- python -m parseur.mcp_server # as a module
273
- uvx --from "parseur-py[mcp]" parseur-py # zero-install with uv
274
- ```
275
-
276
- ### Configure your client
277
-
278
- Add Parseur to your MCP client config. Example for **Claude Desktop**
279
- (`claude_desktop_config.json`).
280
-
281
- Zero-install with `uv` (recommended — nothing to install or keep updated):
282
-
283
- ```json
284
- {
285
- "mcpServers": {
286
- "parseur": {
287
- "command": "uvx",
288
- "args": ["--from", "parseur-py[mcp]", "parseur-py"],
289
- "env": {
290
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
291
- }
292
- }
293
- }
294
- }
295
- ```
296
-
297
- Or, if you installed `parseur-py[mcp]` yourself, point at the console script:
298
-
299
- ```json
300
- {
301
- "mcpServers": {
302
- "parseur": {
303
- "command": "parseur-mcp",
304
- "env": {
305
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
306
- }
307
- }
308
- }
309
- }
310
- ```
311
-
312
- ### Available tools
313
-
314
- Every tool carries a title, a description, per-argument descriptions, behavioral
315
- annotations (read-only / destructive / idempotent / open-world hints), and a
316
- structured JSON output schema — so the assistant understands exactly what each
317
- command does, what it expects, and what it returns. Destructive tools
318
- (`delete_*`) are flagged so clients can ask for confirmation first.
319
-
320
- The server exposes the full client surface as **54 MCP tools**:
321
-
322
- - **Mailboxes**: `list_mailboxes`, `get_mailbox`, `get_mailbox_schema`, `create_mailbox`, `delete_mailbox`
323
- - **Mailbox settings** (one tool per setting, instead of a generic update): `rename_mailbox`, `set_ai_engine`, `set_ai_instructions`, `set_email_processing`, `set_metadata`, `set_timezone`, `set_date_format`, `set_decimal_separator`, `set_allowed_extensions`, `set_sender_filter`, `split_by_ai`, `split_by_page`, `split_by_page_range`, `split_by_keywords`, `process_page_range`, `process_odd_pages`, `process_even_pages`
324
- - **Parser fields**: `list_parser_fields`, `add_parser_field`, `update_parser_field`, `delete_parser_field`
325
- - **Documents**: `list_documents`, `get_document`, `get_document_logs`, `reprocess_document`, `skip_document`, `copy_document`, `split_document`, `reverse_split_document`, `delete_document`
326
- - **Uploads**: `upload_file`, `upload_text` (asynchronous) and `upload_file_and_wait`, `upload_text_and_wait`, `wait_for_document` (block until parsed)
327
- - **Webhooks**: `list_webhooks`, `get_webhook`, `create_webhook`, `delete_webhook`, `enable_webhook`, `pause_webhook`
328
- - **Exports**: `get_mailbox_export`, `get_table_export`, `list_export_fields`, `list_export_configs`, `get_export_config`, `create_export_config`, `update_export_config`, `delete_export_config`
329
-
330
- > **Uploading files over MCP:** `upload_file` takes a **file path** and the server reads it directly — just give the absolute path, no base64. When the desktop app launches the server locally (the usual setup) it runs on your machine, so it can read your files; no extra permission/config is needed (this server is not sandboxed to specific folders). To copy a document that is already in another mailbox, use `copy_document` instead — no file transfer at all.
331
-
332
- > **Getting results out as a file:** three kinds of export, each returning ready-to-use, self-authenticating `csv` / `json` / `xlsx` download links you can hand to the user. `get_mailbox_export` exports the whole mailbox (one row per document); `get_table_export` exports a single table field's rows (one row per line item); for a custom column selection, build an export config with `list_export_fields` + `create_export_config`.
333
-
334
- ### Workflow
335
-
336
- The tools follow the lifecycle of a mailbox — the server ships these same instructions so the assistant can follow the flow on its own:
337
-
338
- 1. **Create a mailbox** with just a title (`create_mailbox`). Don't define fields up front: Parseur auto-detects them from the first documents during its identification phase. Adjust them afterwards with `add_parser_field` / `update_parser_field` / `delete_parser_field`.
339
- 2. **Send documents** to parse with `upload_file` (a path on the server's machine) or `upload_text` (email/HTML content).
340
- 3. **Wait for the result.** Parsing is asynchronous: a document is pending while its status is `INCOMING` / `ANALYZING` / `PROGRESS` and finished at `PARSEDOK` (or `PARSEDKO` / `EXPORTKO`). The parsed data is in the document's `result` field, populated only once it reaches `PARSEDOK`. Prefer `upload_file_and_wait` / `upload_text_and_wait` to get it in one call, or `wait_for_document` to wait on an existing document.
341
- 4. **Get the data out** as a file via the three exports above, or push each parsed document to a URL in real time with `create_webhook`.
342
-
343
- IDs follow a simple convention: mailboxes and webhooks use an integer id, documents a string id, parser/table fields a `PF...` string id, and export configs an integer id.
344
-
345
- ### Publishing to the MCP Registry
346
-
347
- The server is described by [`server.json`](server.json) and can be published to the official [MCP Registry](https://registry.modelcontextprotocol.io) under the `io.github.parseur/parseur-py` name. Ownership is verified through the GitHub `parseur` organization and the `<!-- mcp-name: io.github.parseur/parseur-py -->` marker shipped in this README (so it is present in the PyPI package).
348
-
349
- ```bash
350
- # 1. Install the publisher CLI
351
- curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
352
-
353
- # 2. Authenticate (opens GitHub; you must be a member of the `parseur` org)
354
- ./mcp-publisher login github
355
-
356
- # 3. Publish the version described in server.json
357
- ./mcp-publisher publish
358
- ```
359
-
360
- Before publishing, make sure the version in `server.json` (both the top-level `version` and `packages[].version`) matches a release of `parseur-py` already on PyPI whose README contains the `mcp-name` marker. A GitHub Actions workflow (`.github/workflows/publish-mcp-registry.yml`) does this automatically on each GitHub release using GitHub OIDC.
361
-
362
- Once published, clients install and run the server with:
363
-
364
- ```bash
365
- uvx --from "parseur-py[mcp]" parseur-py
366
- ```
237
+ Parseur hosts an [MCP](https://modelcontextprotocol.io) server at `https://api.parseur.com/mcp`. Add this URL to any MCP-compatible AI assistant (Claude, Codex, Cursor, …) to drive Parseur from it. No local install is needed.
367
238
 
368
239
  ---
369
240
 
@@ -660,29 +660,5 @@ def listen(
660
660
  )
661
661
 
662
662
 
663
- # ------------------------
664
- # MCP server
665
- # ------------------------
666
-
667
-
668
- @cli.command("mcp")
669
- def mcp():
670
- """
671
- Run the Parseur MCP server (requires the [mcp] extra).
672
-
673
- Exposes Parseur as Model Context Protocol tools over stdio so AI
674
- assistants (Claude Desktop, Cursor, ...) can manage your mailboxes,
675
- documents, and webhooks.
676
-
677
- Install with: pip install "parseur-py[mcp]"
678
- """
679
- try:
680
- from . import mcp_server
681
- except ImportError as e:
682
- raise click.ClickException(str(e))
683
-
684
- mcp_server.main()
685
-
686
-
687
663
  if __name__ == "__main__":
688
664
  cli()
@@ -264,9 +264,8 @@ class Document:
264
264
  """
265
265
  Upload a local file to a mailbox.
266
266
 
267
- The file is read from the filesystem of the machine running this code
268
- (for an MCP server, that is the server's machine — usually the same as
269
- the client when launched locally by Claude Desktop). ``~`` is expanded.
267
+ The file is read from the filesystem of the machine running this code.
268
+ ``~`` is expanded.
270
269
 
271
270
  :raises FileNotFoundError: If no readable file exists at ``file_path``.
272
271
  """
@@ -274,7 +273,7 @@ class Document:
274
273
  if not path.is_file():
275
274
  raise FileNotFoundError(
276
275
  f"No file at '{path}'. The file must exist on the machine "
277
- f"running the Parseur client/MCP server; pass an absolute path."
276
+ f"running the Parseur client; pass an absolute path."
278
277
  )
279
278
  with open(path, "rb") as file:
280
279
  files = {"file": (path.name, file)}
@@ -1,13 +1,14 @@
1
1
  from enum import Enum
2
2
 
3
- from marshmallow import RAISE, fields, validate
3
+ from marshmallow import RAISE, fields
4
4
 
5
5
  from parseur.schemas import BaseSchema
6
6
 
7
7
 
8
8
  class FieldFormat(str, Enum):
9
9
  """
10
- Enumeration of the data formats a parser field can have.
10
+ The field formats known to this release. Parseur may support more: any
11
+ format string is sent as given, and Parseur checks it.
11
12
 
12
13
  Used as the ``format`` of a field when creating or updating a mailbox's
13
14
  fields (``parser_object_set``).
@@ -23,6 +24,7 @@ class FieldFormat(str, Enum):
23
24
  ADDRESS = "ADDRESS"
24
25
  TABLE = "TABLE"
25
26
  LINK = "LINK"
27
+ URL = "URL"
26
28
 
27
29
 
28
30
  class TableFieldReadSchema(BaseSchema):
@@ -41,13 +43,8 @@ class ParserFieldBaseSchema(BaseSchema):
41
43
  """
42
44
 
43
45
  name = fields.String(required=True)
44
- format = fields.String(
45
- required=True,
46
- validate=validate.OneOf(
47
- [e.value for e in FieldFormat],
48
- error="Must be one of: " + ", ".join(e.value for e in FieldFormat) + ".",
49
- ),
50
- )
46
+ # Not checked here: Parseur checks it, so formats added after this release still work
47
+ format = fields.String(required=True)
51
48
  query = fields.String(allow_none=True)
52
49
  choice_set = fields.List(fields.String(), allow_none=True)
53
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parseur-py
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: A Python client for the Parseur.com API to manage mailboxes, documents, uploads, and listen for new parsing events.
5
5
  Author-email: Parseur Team <admin@parseur.com>
6
6
  Project-URL: Homepage, https://github.com/parseur/parseur-py
@@ -14,13 +14,8 @@ Requires-Dist: requests>=2.31.0
14
14
  Requires-Dist: marshmallow>=4.0.0
15
15
  Provides-Extra: listener
16
16
  Requires-Dist: Flask>=3.1.0; extra == "listener"
17
- Provides-Extra: mcp
18
- Requires-Dist: mcp>=1.18.0; extra == "mcp"
19
- Requires-Dist: pydantic>=2.0; extra == "mcp"
20
17
  Dynamic: license-file
21
18
 
22
- <!-- mcp-name: io.github.parseur/parseur-py -->
23
-
24
19
  # 🤖🧙parseur-py
25
20
 
26
21
  **parseur-py** is a modern Python client for the [Parseur](https://parseur.com) API.
@@ -47,7 +42,6 @@ Built to help you automate document parsing at scale, parseur-py makes integrati
47
42
  ✅ Manage custom webhooks for real-time events
48
43
  ✅ Listen to events in real time with a temporary webhook & tunnel
49
44
  ✅ Fully-featured **Command Line Interface (CLI)**
50
- ✅ Built-in **MCP server** to drive Parseur from AI assistants (Claude, Cursor, …)
51
45
 
52
46
  ---
53
47
 
@@ -79,12 +73,6 @@ With event listener support (Flask + localtunnel)
79
73
  pip install "parseur-py[listener]"
80
74
  ```
81
75
 
82
- With MCP server support (use Parseur from AI assistants)
83
-
84
- ```bash
85
- pip install "parseur-py[mcp]"
86
- ```
87
-
88
76
  ### Install the package from source
89
77
 
90
78
  ```bash
@@ -211,7 +199,6 @@ for a full list of available commands.
211
199
  - **create-webhook / get-webhook / list-webhooks / delete-webhook**: Create, get, list, and delete custom webhook integrations.
212
200
  - **enable-webhook / pause-webhook**: Activate or pause a webhook for a specific mailbox.
213
201
  - **listen**: Create a temporary webhook and listen to events in real time (with optional redirect & silent mode)
214
- - **mcp**: Run the Parseur MCP server so AI assistants can manage your account (requires `[mcp]`)
215
202
 
216
203
  ---
217
204
 
@@ -265,126 +252,7 @@ Your webhook endpoint will receive POST notifications with Parseur payloads, ena
265
252
 
266
253
  ## 🤖 MCP Server (AI assistants)
267
254
 
268
- **parseur-py** ships an [MCP](https://modelcontextprotocol.io) server that exposes Parseur as tools any MCP-compatible AI assistant (Claude Desktop, Cursor, Claude Code, …) can call directly — listing mailboxes, uploading documents, reading parsed results, managing webhooks, and more.
269
-
270
- ### Install
271
-
272
- The MCP server is an **optional** feature, behind the `mcp` extra (it pulls in
273
- the `mcp` SDK and `pydantic`; the base `parseur-py` install does not):
274
-
275
- ```bash
276
- pip install "parseur-py[mcp]"
277
- ```
278
-
279
- > Zero-install: if you have [`uv`](https://docs.astral.sh/uv/), you don't need to
280
- > install anything — `uvx --from "parseur-py[mcp]" parseur-py` runs the server in
281
- > a throwaway environment. This is the recommended way to wire it into an MCP
282
- > client (see below).
283
-
284
- ### Run
285
-
286
- The server speaks MCP over **stdio**. It reads your API key from
287
- `~/.parseur.conf` (run `parseur init` first) or from the `PARSEUR_API_KEY`
288
- environment variable (which takes precedence — MCP clients usually inject it).
289
-
290
- ```bash
291
- parseur mcp # via the main CLI (needs the [mcp] extra)
292
- parseur-mcp # dedicated console script
293
- python -m parseur.mcp_server # as a module
294
- uvx --from "parseur-py[mcp]" parseur-py # zero-install with uv
295
- ```
296
-
297
- ### Configure your client
298
-
299
- Add Parseur to your MCP client config. Example for **Claude Desktop**
300
- (`claude_desktop_config.json`).
301
-
302
- Zero-install with `uv` (recommended — nothing to install or keep updated):
303
-
304
- ```json
305
- {
306
- "mcpServers": {
307
- "parseur": {
308
- "command": "uvx",
309
- "args": ["--from", "parseur-py[mcp]", "parseur-py"],
310
- "env": {
311
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
312
- }
313
- }
314
- }
315
- }
316
- ```
317
-
318
- Or, if you installed `parseur-py[mcp]` yourself, point at the console script:
319
-
320
- ```json
321
- {
322
- "mcpServers": {
323
- "parseur": {
324
- "command": "parseur-mcp",
325
- "env": {
326
- "PARSEUR_API_KEY": "YOUR_PARSEUR_API_KEY"
327
- }
328
- }
329
- }
330
- }
331
- ```
332
-
333
- ### Available tools
334
-
335
- Every tool carries a title, a description, per-argument descriptions, behavioral
336
- annotations (read-only / destructive / idempotent / open-world hints), and a
337
- structured JSON output schema — so the assistant understands exactly what each
338
- command does, what it expects, and what it returns. Destructive tools
339
- (`delete_*`) are flagged so clients can ask for confirmation first.
340
-
341
- The server exposes the full client surface as **54 MCP tools**:
342
-
343
- - **Mailboxes**: `list_mailboxes`, `get_mailbox`, `get_mailbox_schema`, `create_mailbox`, `delete_mailbox`
344
- - **Mailbox settings** (one tool per setting, instead of a generic update): `rename_mailbox`, `set_ai_engine`, `set_ai_instructions`, `set_email_processing`, `set_metadata`, `set_timezone`, `set_date_format`, `set_decimal_separator`, `set_allowed_extensions`, `set_sender_filter`, `split_by_ai`, `split_by_page`, `split_by_page_range`, `split_by_keywords`, `process_page_range`, `process_odd_pages`, `process_even_pages`
345
- - **Parser fields**: `list_parser_fields`, `add_parser_field`, `update_parser_field`, `delete_parser_field`
346
- - **Documents**: `list_documents`, `get_document`, `get_document_logs`, `reprocess_document`, `skip_document`, `copy_document`, `split_document`, `reverse_split_document`, `delete_document`
347
- - **Uploads**: `upload_file`, `upload_text` (asynchronous) and `upload_file_and_wait`, `upload_text_and_wait`, `wait_for_document` (block until parsed)
348
- - **Webhooks**: `list_webhooks`, `get_webhook`, `create_webhook`, `delete_webhook`, `enable_webhook`, `pause_webhook`
349
- - **Exports**: `get_mailbox_export`, `get_table_export`, `list_export_fields`, `list_export_configs`, `get_export_config`, `create_export_config`, `update_export_config`, `delete_export_config`
350
-
351
- > **Uploading files over MCP:** `upload_file` takes a **file path** and the server reads it directly — just give the absolute path, no base64. When the desktop app launches the server locally (the usual setup) it runs on your machine, so it can read your files; no extra permission/config is needed (this server is not sandboxed to specific folders). To copy a document that is already in another mailbox, use `copy_document` instead — no file transfer at all.
352
-
353
- > **Getting results out as a file:** three kinds of export, each returning ready-to-use, self-authenticating `csv` / `json` / `xlsx` download links you can hand to the user. `get_mailbox_export` exports the whole mailbox (one row per document); `get_table_export` exports a single table field's rows (one row per line item); for a custom column selection, build an export config with `list_export_fields` + `create_export_config`.
354
-
355
- ### Workflow
356
-
357
- The tools follow the lifecycle of a mailbox — the server ships these same instructions so the assistant can follow the flow on its own:
358
-
359
- 1. **Create a mailbox** with just a title (`create_mailbox`). Don't define fields up front: Parseur auto-detects them from the first documents during its identification phase. Adjust them afterwards with `add_parser_field` / `update_parser_field` / `delete_parser_field`.
360
- 2. **Send documents** to parse with `upload_file` (a path on the server's machine) or `upload_text` (email/HTML content).
361
- 3. **Wait for the result.** Parsing is asynchronous: a document is pending while its status is `INCOMING` / `ANALYZING` / `PROGRESS` and finished at `PARSEDOK` (or `PARSEDKO` / `EXPORTKO`). The parsed data is in the document's `result` field, populated only once it reaches `PARSEDOK`. Prefer `upload_file_and_wait` / `upload_text_and_wait` to get it in one call, or `wait_for_document` to wait on an existing document.
362
- 4. **Get the data out** as a file via the three exports above, or push each parsed document to a URL in real time with `create_webhook`.
363
-
364
- IDs follow a simple convention: mailboxes and webhooks use an integer id, documents a string id, parser/table fields a `PF...` string id, and export configs an integer id.
365
-
366
- ### Publishing to the MCP Registry
367
-
368
- The server is described by [`server.json`](server.json) and can be published to the official [MCP Registry](https://registry.modelcontextprotocol.io) under the `io.github.parseur/parseur-py` name. Ownership is verified through the GitHub `parseur` organization and the `<!-- mcp-name: io.github.parseur/parseur-py -->` marker shipped in this README (so it is present in the PyPI package).
369
-
370
- ```bash
371
- # 1. Install the publisher CLI
372
- curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
373
-
374
- # 2. Authenticate (opens GitHub; you must be a member of the `parseur` org)
375
- ./mcp-publisher login github
376
-
377
- # 3. Publish the version described in server.json
378
- ./mcp-publisher publish
379
- ```
380
-
381
- Before publishing, make sure the version in `server.json` (both the top-level `version` and `packages[].version`) matches a release of `parseur-py` already on PyPI whose README contains the `mcp-name` marker. A GitHub Actions workflow (`.github/workflows/publish-mcp-registry.yml`) does this automatically on each GitHub release using GitHub OIDC.
382
-
383
- Once published, clients install and run the server with:
384
-
385
- ```bash
386
- uvx --from "parseur-py[mcp]" parseur-py
387
- ```
255
+ Parseur hosts an [MCP](https://modelcontextprotocol.io) server at `https://api.parseur.com/mcp`. Add this URL to any MCP-compatible AI assistant (Claude, Codex, Cursor, …) to drive Parseur from it. No local install is needed.
388
256
 
389
257
  ---
390
258
 
@@ -10,7 +10,6 @@ pyproject.toml
10
10
  ./parseur/event.py
11
11
  ./parseur/export_config.py
12
12
  ./parseur/mailbox.py
13
- ./parseur/mcp_server.py
14
13
  ./parseur/parser_field.py
15
14
  ./parseur/server.py
16
15
  ./parseur/utils.py
@@ -30,7 +29,6 @@ parseur/document.py
30
29
  parseur/event.py
31
30
  parseur/export_config.py
32
31
  parseur/mailbox.py
33
- parseur/mcp_server.py
34
32
  parseur/parser_field.py
35
33
  parseur/server.py
36
34
  parseur/utils.py
@@ -52,6 +50,5 @@ tests/test_cli.py
52
50
  tests/test_document.py
53
51
  tests/test_export_config.py
54
52
  tests/test_mailbox.py
55
- tests/test_mcp_server.py
56
53
  tests/test_parser_field.py
57
54
  tests/test_webhook.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ parseur = parseur.cli:cli
@@ -4,7 +4,3 @@ marshmallow>=4.0.0
4
4
 
5
5
  [listener]
6
6
  Flask>=3.1.0
7
-
8
- [mcp]
9
- mcp>=1.18.0
10
- pydantic>=2.0