doc2x-mcp
v0.1.7Doc2x MCP server (stdio, MCP SDK).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
doc2x_parse_pdf_submit
Create a Doc2x PDF parse task for a local file and return {uid}. Prefer calling doc2x_parse_pdf_status to monitor progress/result; only call doc2x_parse_pdf_wait_text if the user explicitly asks to wait/return merged text.
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Absolute path to a local PDF file. Use an absolute path (relative paths are resolved from the MCP server process cwd, which may be '/'). Must end with '.pdf'. |
model | string | Optional parse model. Supported values: 'v2' and 'v3-2026'. Omit this field to use default v2. |
doc2x_parse_pdf_status
Query parse task status by uid. Returns {status, progress, detail}. status is one of processing/failed/success; progress is an integer 0..100; detail is populated only when status=failed. Fetch parsed content via doc2x_convert_export_*.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
doc2x_parse_pdf_wait_text
Wait for a PDF parse task until success and return merged text. Prefer passing uid (no re-submit). If only pdf_path is provided, it will (a) reuse an in-process cached uid if available, otherwise (b) submit a new task then wait.
| Parameter | Type | Description |
|---|---|---|
join_with | string | |
max_output_chars | integer | Max characters of returned text (0 = unlimited). Useful to avoid LLM context overflow. Default can be set via env DOC2X_PARSE_PDF_MAX_OUTPUT_CHARS. |
max_output_pages | integer | Max pages to merge into returned text (0 = unlimited). Default can be set via env DOC2X_PARSE_PDF_MAX_OUTPUT_PAGES. |
max_wait_ms | integer | |
model | string | Optional parse model used only when submitting from pdf_path. Supported values: 'v2' and 'v3-2026'. Omit this field to use default v2. |
pdf_path | string | Absolute path to a local PDF file. If uid is not provided, this tool will reuse cached uid (if any) or submit a new task. |
poll_interval_ms | integer | |
uid | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
doc2x_materialize_pdf_layout_json
Wait for a PDF parse task and write the raw Doc2x result JSON (with page layout) to output_path. Prefer passing uid. If only pdf_path is provided, this tool reuses a cached uid or submits a new parse with model='v3-2026' by default.
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Absolute path for the output JSON file. The file will be overwritten if it exists. |
max_wait_ms | integer | |
model | string | Optional parse model used only when submitting from pdf_path. Supported values: 'v2' and 'v3-2026'. Defaults to 'v3-2026' for this tool because v2 does not return layout. |
pdf_path | string | Absolute path to a local PDF file. If uid is not provided, this tool will reuse cached uid (if any) or submit a new task. |
poll_interval_ms | integer | |
uid | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
doc2x_convert_export_submit
Start an export (convert) job for a parsed PDF uid. After this, poll with doc2x_convert_export_wait or doc2x_convert_export_result. Do NOT call doc2x_convert_export_submit twice for the same uid+format in parallel.
| Parameter | Type | Description |
|---|---|---|
formula_mode * | string | |
to * | string | |
uid * | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
filename | string | Optional output filename (for md/tex only). Tip: pass a basename WITHOUT extension to avoid getting 'name.md.md' / 'name.tex.tex'. |
filename_mode | string | How to treat filename. 'auto' strips the target extension and shortens names exceeding 50 Unicode characters with a stable hash suffix; 'raw' preserves the basename and rejects names over 50 character… |
formula_level | Optional formula degradation level. Effective only when source parse uses model=v3-2026 (ignored by v2). 0: keep formulas, 1: degrade inline formulas, 2: degrade inline and block formulas. | |
merge_cross_page_forms | boolean |
doc2x_convert_export_result
Get the latest export (convert) result for a parsed PDF uid (may contain an escaped URL).
| Parameter | Type | Description |
|---|---|---|
uid * | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
doc2x_convert_export_wait
Wait for an export job to finish. Prefer calling doc2x_convert_export_submit first, then wait with uid+to. For backward compatibility, if formula_mode is provided and this job was not submitted in-process, this tool will submit once then wait.
| Parameter | Type | Description |
|---|---|---|
to * | string | Expected target format. Rejects contradictory legacy URL format hints; current download URLs may use opaque object IDs. Keep exports for the same uid sequential. |
uid * | string | Doc2x parse task uid returned by doc2x_parse_pdf_submit. |
filename | string | |
filename_mode | string | For auto-submission: 'auto' strips the target extension and shortens names to at most 50 Unicode characters with a stable hash suffix; 'raw' preserves the basename and rejects longer names. |
formula_level | Optional formula degradation level used when this tool auto-submits export (formula_mode must be provided). Effective only when source parse uses model=v3-2026 (ignored by v2). | |
formula_mode | string | |
max_wait_ms | integer | |
merge_cross_page_forms | boolean | |
poll_interval_ms | integer |
doc2x_parse_image_layout_sync
Parse an image layout synchronously and return the raw Doc2x result JSON (including convert_zip when present).
| Parameter | Type | Description |
|---|---|---|
image_path * | string | Absolute path to a local image file (png/jpg). Use an absolute path (relative paths are resolved from the MCP server process cwd, which may be '/'). |
doc2x_parse_image_layout_submit
Create an async image-layout parse task and return {uid}. After this, call doc2x_parse_image_layout_wait_text (with uid) or doc2x_parse_image_layout_status.
| Parameter | Type | Description |
|---|---|---|
image_path * | string | Absolute path to a local image file (png/jpg). Use an absolute path (relative paths are resolved from the MCP server process cwd, which may be '/'). |
doc2x_parse_image_layout_status
Get status/result for an existing async image-layout parse task by uid.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Doc2x image-layout parse task uid returned by doc2x_parse_image_layout_submit. |
doc2x_parse_image_layout_wait_text
Wait for an image-layout parse task until success, returning first page markdown. Prefer passing uid (no re-submit). If only image_path is provided, it will (a) reuse an in-process cached uid if available, otherwise (b) submit a new async task then wait.
| Parameter | Type | Description |
|---|---|---|
image_path | string | Absolute path to a local image file (png/jpg). Used to reuse cached uid or submit a new async task. |
max_wait_ms | integer | |
poll_interval_ms | integer | |
uid | string | Doc2x image-layout parse task uid returned by doc2x_parse_image_layout_submit. |
doc2x_download_url_to_file
Download a Doc2x-provided URL (e.g. from doc2x_convert_export_result) to a local file path.
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Absolute path for the output file. The file will be overwritten if it exists. |
url * | string | A URL returned by doc2x_convert_export_result (may contain escaped '\u0026'). |
doc2x_materialize_convert_zip
Materialize convert_zip (base64) into output_dir. Best-effort: tries system unzip first; otherwise writes the zip file.
| Parameter | Type | Description |
|---|---|---|
convert_zip_base64 * | string | |
output_dir * | string |
doc2x_debug_config
Debug helper: return resolved config and API key source for troubleshooting.