API Reference

This page provides detailed API documentation for the Rossum MCP Server.

RossumMCPServer

Rossum MCP Server

Provides tools for uploading documents and retrieving annotations using Rossum API

class rossum_mcp.server.RossumMCPServer[source]

Bases: object

MCP Server for Rossum API integration

__init__()[source]
async upload_document(file_path, queue_id)[source]

Upload a document to Rossum for processing (async wrapper).

Parameters:
  • file_path (str) – Absolute path to the document file

  • queue_id (int) – Rossum queue ID where the document should be uploaded

Return type:

dict

Returns:

Dictionary containing task_id, task_status, queue_id, and message

async get_annotation(annotation_id, sideloads=())[source]

Retrieve annotation data from Rossum (async wrapper)

Return type:

dict

async list_annotations(queue_id, status='importing,to_review,confirmed,exported')[source]

List annotations for a queue with optional filtering (async wrapper).

Parameters:
  • queue_id (int) – Rossum queue ID to list annotations from

  • status (str | None) – Optional status filter (comma-separated). Defaults to common statuses.

Return type:

dict

Returns:

Dictionary containing count and results list of annotations

async get_queue(queue_id)[source]

Retrieve queue details from Rossum (async wrapper)

Return type:

dict

async get_schema(schema_id)[source]

Retrieve schema data from Rossum (async wrapper)

Return type:

dict

async get_queue_schema(queue_id)[source]

Retrieve schema for a given queue (async wrapper)

Return type:

dict

setup_handlers()[source]

Setup MCP protocol handlers.

Registers the list_tools and call_tool handlers for the MCP server. These handlers define the available tools and their execution logic.

Return type:

None

async run()[source]

Start the MCP server.

Runs the server using stdio transport for communication with MCP clients.

Return type:

None

async rossum_mcp.server.async_main()[source]

Async main entry point.

Creates and runs the RossumMCPServer instance.

Return type:

None

rossum_mcp.server.main()[source]

Main entry point for console script.

This is the entry point used when running the server as a command-line tool. It initializes the async event loop and starts the server.

Return type:

None

Main Server Class

class rossum_mcp.server.RossumMCPServer[source]

Bases: object

MCP Server for Rossum API integration

__init__()[source]
async upload_document(file_path, queue_id)[source]

Upload a document to Rossum for processing (async wrapper).

Parameters:
  • file_path (str) – Absolute path to the document file

  • queue_id (int) – Rossum queue ID where the document should be uploaded

Return type:

dict

Returns:

Dictionary containing task_id, task_status, queue_id, and message

async get_annotation(annotation_id, sideloads=())[source]

Retrieve annotation data from Rossum (async wrapper)

Return type:

dict

async list_annotations(queue_id, status='importing,to_review,confirmed,exported')[source]

List annotations for a queue with optional filtering (async wrapper).

Parameters:
  • queue_id (int) – Rossum queue ID to list annotations from

  • status (str | None) – Optional status filter (comma-separated). Defaults to common statuses.

Return type:

dict

Returns:

Dictionary containing count and results list of annotations

async get_queue(queue_id)[source]

Retrieve queue details from Rossum (async wrapper)

Return type:

dict

async get_schema(schema_id)[source]

Retrieve schema data from Rossum (async wrapper)

Return type:

dict

async get_queue_schema(queue_id)[source]

Retrieve schema for a given queue (async wrapper)

Return type:

dict

setup_handlers()[source]

Setup MCP protocol handlers.

Registers the list_tools and call_tool handlers for the MCP server. These handlers define the available tools and their execution logic.

Return type:

None

async run()[source]

Start the MCP server.

Runs the server using stdio transport for communication with MCP clients.

Return type:

None

Methods

Document Upload

async RossumMCPServer.upload_document(file_path, queue_id)[source]

Upload a document to Rossum for processing (async wrapper).

Parameters:
  • file_path (str) – Absolute path to the document file

  • queue_id (int) – Rossum queue ID where the document should be uploaded

Return type:

dict

Returns:

Dictionary containing task_id, task_status, queue_id, and message

RossumMCPServer._upload_document_sync(file_path, queue_id)[source]

Upload a document to Rossum (synchronous implementation).

Parameters:
  • file_path (str) – Absolute path to the document file

  • queue_id (int) – Rossum queue ID where the document should be uploaded

Return type:

dict

Returns:

Dictionary containing task_id, task_status, queue_id, and message

Raises:

FileNotFoundError – If the specified file does not exist

Annotation Retrieval

async RossumMCPServer.get_annotation(annotation_id, sideloads=())[source]

Retrieve annotation data from Rossum (async wrapper)

Return type:

dict

RossumMCPServer._get_annotation_sync(annotation_id, sideloads=())[source]

Retrieve annotation data from Rossum (synchronous implementation).

Parameters:
  • annotation_id (int) – The annotation ID to retrieve

  • sideloads (Sequence[str]) – List of sideloads to include (e.g., [‘content’])

Return type:

dict

Returns:

Dictionary containing annotation details including id, status, url, content, etc.

async RossumMCPServer.list_annotations(queue_id, status='importing,to_review,confirmed,exported')[source]

List annotations for a queue with optional filtering (async wrapper).

Parameters:
  • queue_id (int) – Rossum queue ID to list annotations from

  • status (str | None) – Optional status filter (comma-separated). Defaults to common statuses.

Return type:

dict

Returns:

Dictionary containing count and results list of annotations

RossumMCPServer._list_annotations_sync(queue_id, status=None)[source]

List annotations for a queue (synchronous implementation).

Parameters:
  • queue_id (int) – Rossum queue ID to list annotations from

  • status (str | None) – Optional status filter (comma-separated)

Return type:

dict

Returns:

Dictionary containing count and results list of annotations

Queue and Schema

async RossumMCPServer.get_queue(queue_id)[source]

Retrieve queue details from Rossum (async wrapper)

Return type:

dict

RossumMCPServer._get_queue_sync(queue_id)[source]

Retrieve queue details (synchronous implementation).

Parameters:

queue_id (int) – Rossum queue ID to retrieve

Return type:

dict

Returns:

Dictionary containing queue details including schema_id

async RossumMCPServer.get_schema(schema_id)[source]

Retrieve schema data from Rossum (async wrapper)

Return type:

dict

RossumMCPServer._get_schema_sync(schema_id)[source]

Retrieve schema details (synchronous implementation).

Parameters:

schema_id (int) – Rossum schema ID to retrieve

Return type:

dict

Returns:

Dictionary containing schema details and content

async RossumMCPServer.get_queue_schema(queue_id)[source]

Retrieve schema for a given queue (async wrapper)

Return type:

dict

RossumMCPServer._get_queue_schema_sync(queue_id)[source]

Retrieve complete schema for a queue (synchronous implementation).

This convenience method combines queue and schema retrieval in a single call.

Parameters:

queue_id (int) – Rossum queue ID

Return type:

dict

Returns:

Dictionary containing queue and schema details including schema content

Server Management

RossumMCPServer.setup_handlers()[source]

Setup MCP protocol handlers.

Registers the list_tools and call_tool handlers for the MCP server. These handlers define the available tools and their execution logic.

Return type:

None

The setup_handlers method registers two critical MCP protocol handlers:

  1. list_tools() - Returns the list of available MCP tools:

    • upload_document - Upload documents to Rossum queues

    • get_annotation - Retrieve annotation data by ID

    • list_annotations - List annotations for a queue with filtering

    • get_queue - Get queue details including schema_id

    • get_schema - Get schema details and content

    • get_queue_schema - Get complete queue schema in one call

  2. call_tool() - Executes the requested tool with provided arguments

Each tool definition includes:

  • Tool name and description

  • Input schema (JSON Schema format)

  • Required and optional parameters

  • Parameter types and descriptions

async RossumMCPServer.run()[source]

Start the MCP server.

Runs the server using stdio transport for communication with MCP clients.

Return type:

None

Functions

async rossum_mcp.server.async_main()[source]

Async main entry point.

Creates and runs the RossumMCPServer instance.

Return type:

None

rossum_mcp.server.main()[source]

Main entry point for console script.

This is the entry point used when running the server as a command-line tool. It initializes the async event loop and starts the server.

Return type:

None