SwissDocAI

v0.2.1
ch.swissdocai/mcp Checked 2 days ago Published 2 days ago

MCP server for SwissDocAI: OCR, classification, extraction, layout and redaction of local documents, processed in Switzerland

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

process_document Process a document

OCR, classification into the workspace's labels and extraction of the label's fields for one local document. Returns the label, the confidence, the extracted fields and the text. Labels and fields are set up in the SwissDocAI console.

ParameterTypeDescription
path *stringPath of a local PDF, PNG or JPEG file (absolute, or relative to the server's working directory).
filename_templateWith rename: a template that overrides the label's, e.g. {label}_{original}. Other placeholders are the label's field names.
include_textbooleanReturn the OCR text too (it can be long).
model_versionOptional, v1 or v2. v2 uses newer models: better classification and extraction, results can differ from v1. Without it v1 runs, unless the account has a table field: then v2. With v1 table fields stay…
output_pathOptional path of a local file to write the full result to. Then only a short summary without the document's content is returned.
renamebooleanSuggest a file name from the matched label's file name template.
save_split_pdfsbooleanWith split_documents: write every document found as its own PDF next to the source file.
split_documentsbooleanFind several documents in one PDF and classify and extract each.

ocr_document Read a document's text (OCR)

The text of a local document (OCR), as Markdown with page markers. Tables come out as Markdown tables. For documents of many pages, prefer output_path.

ParameterTypeDescription
path *stringPath of a local PDF, PNG or JPEG file (absolute, or relative to the server's working directory).
model_versionOptional, v1 or v2. v2 uses newer models: better classification and extraction, results can differ from v1. Without it v1 runs, unless the account has a table field: then v2. With v1 table fields stay…
output_pathOptional path of a local file to write the full result to. Then only a short summary without the document's content is returned.

analyze_layout Analyze a document's layout

Words, lines, paragraphs, tables and checkboxes of a local document with their boxes on the page, in the shape of Azure AI Document Intelligence's prebuilt-layout (status, createdDateTime, lastUpdatedDateTime, analyzeResult). The result is large, so it is written to a JSON file; a summary comes back. Up to 50 pages (beta).

ParameterTypeDescription
path *stringPath of a local PDF, PNG or JPEG file (absolute, or relative to the server's working directory).
include_contentbooleanAlso return the document's text (content).
output_pathPath of the JSON file to write the result to. Default: next to the source, as <name>.layout.json.

redact_document Redact personal data

Find personal data in a local document and black it out (beta). Writes the redacted PDF next to the source file; the source is never changed. Review the result before passing it on: the redaction is automatic.

ParameterTypeDescription
path *stringPath of a local PDF, PNG or JPEG file (absolute, or relative to the server's working directory).
categoriesCategories to search. Default: person, birth_date, address, contact, identifier, financial. Also possible: date (other dates such as appointments), organization (data of organizations).
include_valuesbooleanReturn the values found (names, dates, numbers). Off by default: the values are the personal data being removed.
keepWhat to keep readable, e.g. 'names and addresses of clinics'.
notesContext about the documents, e.g. 'medical reports'.
output_pathWhere to write the result. Default: next to the source, as <name>.redacted.pdf (render) or <name>.redaction.json.
qr_codesbooleanBlack out every QR code (the payment part of a QR-bill holds names and IBAN).
redactWhat to black out, in words, e.g. 'names of patients'.
renderbooleanWrite the redacted PDF (bars burnt in, no text layer, checked by reading it again). False: only the findings with their boxes, as JSON.

list_labels List labels

All labels of the token's workspace, with their description, examples, fields, file name template and revision. Labels are what process_document classifies into.

get_label Get a label

One label with its current revision. Read it before changing it.

ParameterTypeDescription
label_id *stringThe label's label_id, e.g. invoice.

create_label Create a label

Create a label in the workspace. Needs an API token with read and write access to labels. Free of charge; at most 60 label changes per minute.

ParameterTypeDescription
label_id *stringNew identifier: lowercase letters, digits, - and _, e.g. invoice.
name *stringDisplay name, e.g. Rechnung.
descriptionWhat documents of this label look like; the classifier reads it.
examplesShort typical phrases or titles of such documents (up to 30).
extraction_schemaThe fields to extract (up to 50, at most 5 tables).
filename_templateFile name for process_document with rename: {label}, {original} and the names of the label's fields (not tables), e.g. {Rechnungsdatum}_{Absender}.

update_label Change a label

Change a label: only the arguments given change. examples and extraction_schema replace the whole list, so send every entry that should stay. An empty description or filename_template clears it. Every change is kept as a revision and can be undone with restore_label_revision. Needs a token with read and write access.

ParameterTypeDescription
label_id *stringThe label's label_id, e.g. invoice.
revision *integerThe label's current revision, from get_label or list_labels. The change is made only if the label is still at this revision.
descriptionWhat documents of this label look like; the classifier reads it.
examplesShort typical phrases or titles of such documents (up to 30).
extraction_schemaThe fields to extract (up to 50, at most 5 tables).
filename_templateFile name for process_document with rename: {label}, {original} and the names of the label's fields (not tables), e.g. {Rechnungsdatum}_{Absender}.
name

delete_label Delete a label

Delete a label for good, with all its revisions: it cannot be restored and documents are no longer classified into it. Ask the user before deleting. Needs a token with read and write access.

ParameterTypeDescription
label_id *stringThe label's label_id, e.g. invoice.
revision *integerThe label's current revision, from get_label or list_labels. The change is made only if the label is still at this revision.

list_label_revisions List a label's revisions

Earlier states of a label, newest first (the last 50): what it looked like after each change, whether the change came through the API or the console, and when.

ParameterTypeDescription
label_id *stringThe label's label_id, e.g. invoice.

restore_label_revision Restore a label revision

Give a label the content of an earlier revision. This is itself a new revision, so it can be undone too. Needs a token with read and write access.

ParameterTypeDescription
label_id *stringThe label's label_id, e.g. invoice.
revision *integerThe revision to go back to, from list_label_revisions.

classify_text Classify a text

Classify a text into the workspace's labels: the label, the confidence and the reasoning. Use it to check a label after changing it, with the text of a known document (ocr_document once, then classify as often as needed). Costs one page of quota per call.

ParameterTypeDescription
text *stringThe document's text, e.g. from ocr_document.
model_versionOptional, v1 or v2, as in process_document.