Skip to main content

OCI Document Understanding MCP Server

Platform compatibility

The locked cryptography dependency no longer supports Intel macOS or 32-bit Windows. Use Apple Silicon macOS, 64-bit Windows, or a supported Linux environment.

Overview

This FastMCP-based server provides MCP tools for OCI Document Understanding extraction and classification workflows.

It supports stdio transport only. It does not expose HTTP, streamable HTTP, OAuth, IDCS bearer-token validation, /mcp, or /.well-known/* endpoints.

Running the Server

STDIO Transport Mode

uvx oracle.oci-document-understanding-mcp-server

For local source testing:

uv run oracle.oci-document-understanding-mcp-server

For local wheel testing:

uvx \
  --python 3.13 \
  --no-python-downloads \
  --from ./dist/oracle_oci_document_understanding_mcp_server-0.2.0-py3-none-any.whl \
  oracle.oci-document-understanding-mcp-server

Authentication

For real OCI calls, the server uses oracle-mcp-common to resolve OCI SDK authentication. Set OCI_MCP_AUTH_TYPE when you need a specific mode:

  • security_token
  • api_key
  • instance_principal
  • resource_principal
  • instance_principal_delegation
  • resource_principal_delegation
  • oke_workload_identity
  • identity_domain_upst

When OCI_MCP_AUTH_TYPE is unset, the common library's auto mode uses a security token only when the selected OCI profile directly declares security_token_file; otherwise it uses API-key authentication. Principal authentication modes must be selected explicitly.

DOCUMENT_MCP_MODE selects the provider, not the authentication mode:

DOCUMENT_MCP_MODE Description
oci (default) Real OCI Document Understanding SDK provider.
stub Deterministic fake provider for local MCP flow testing.

For local session-token authentication, run:

oci session authenticate --profile-name DEFAULT --region us-phoenix-1

The selected OCI config profile must contain security_token_file and the matching session key_file.

Configuration

Environment Variable Required Default Description
DOCUMENT_MCP_MODE No oci Provider mode: oci or stub.
OCI_MCP_AUTH_TYPE No auto OCI authentication type, resolved by oracle-mcp-common.
OCI_REGION Depends on auth type Profile or signer region OCI region, resolved by oracle-mcp-common.
OCI_COMPARTMENT_ID Yes for non-stub OCI calls None Default compartment OCID for Document Understanding requests.
OCI_CONFIG_PROFILE No DEFAULT OCI config profile, resolved by oracle-mcp-common.
OCI_CONFIG_FILE No OCI SDK default OCI config file, resolved by oracle-mcp-common.

OCI_REGION, when set, takes precedence over the region in an OCI config profile. Otherwise, profile authentication uses the profile region and principal authentication uses the signer region. The OCI SDK derives the official Document Understanding endpoint from that resolved region.

Session-token authentication with the default OCI profile:

OCI_MCP_AUTH_TYPE=security_token \
OCI_COMPARTMENT_ID=ocid1.compartment.oc1..example \
uv run oracle.oci-document-understanding-mcp-server

Instance-principal authentication:

OCI_MCP_AUTH_TYPE=instance_principal \
OCI_COMPARTMENT_ID=ocid1.compartment.oc1..example \
uv run oracle.oci-document-understanding-mcp-server

Tools

Tool Name Description
document_extract Extract text, key-value pairs, tables, and document elements from an inline base64 or Object Storage document.
document_classify Classify an inline base64 or Object Storage document and return candidate document classes.

Input Sources

Inline base64 input:

{
  "document": "<base64-document>",
  "mime_type": "application/pdf",
  "features": ["TEXT", "KEY_VALUE"],
  "options": {
    "language": "en",
    "include_confidence": true
  }
}

Set include_confidence to false to omit confidence fields from extraction results.

Object Storage input:

{
  "document_source": {
    "source_type": "OBJECT_STORAGE",
    "namespace_name": "my_namespace",
    "bucket_name": "my_bucket",
    "object_name": "documents/invoice.pdf"
  },
  "features": ["TEXT", "KEY_VALUE", "TABLE"],
  "options": {
    "language": "en",
    "include_confidence": true
  }
}

Classification input:

{
  "document": "<base64-document>",
  "mime_type": "application/pdf",
  "document_type_hint": "invoice",
  "options": {
    "language": "en",
    "confidence_threshold": 0.2
  }
}

Local Stub Mode

Stub mode validates MCP flow without OCI credentials:

DOCUMENT_MCP_MODE=stub uv run oracle.oci-document-understanding-mcp-server

Use the development test command below for local validation. MCP clients can run the server with the package entry point shown in the running examples above.

Project Layout

oci-document-understanding-mcp-server/
├── LICENSE.txt
├── CHANGELOG.md
├── README.md
├── pyproject.toml
├── uv.lock
└── oracle/
    ├── __init__.py
    └── oci_document_understanding_mcp_server/
        ├── __init__.py
        ├── server.py
        ├── handlers/
        ├── oci/
        ├── parsers/
        ├── response.py
        └── tests/

Development

uv sync --locked --all-extras --dev
uv run pytest --cov=. --cov-branch --cov-report=term-missing
uv build

The package entry point is:

[project.scripts]
"oracle.oci-document-understanding-mcp-server" = "oracle.oci_document_understanding_mcp_server.server:main"

Third-Party APIs

Developers choosing to distribute a binary implementation of this project are responsible for obtaining and providing all required licenses and copyright notices for third-party code used in order to ensure compliance with their respective open source licenses.

Disclaimer

Users are responsible for their local environment, OCI permissions, and credential safety. Different language model selections may yield different results and performance.

License

Copyright (c) 2026 Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.

Metadata

Release files for oracle.oci-document-understanding-mcp-server 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oracle.oci-document-understanding-mcp-server 0.2.0
File Size Uploaded Provenance Actions
oracle_oci_document_understanding_mcp_server-0.2.0.tar.gz 136.5 kB Without provenance Details for oracle_oci_document_understanding_mcp_server-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oracle.oci-document-understanding-mcp-server 0.2.0
File Interpreter ABI Platform Actions
oracle_oci_document_understanding_mcp_server-0.2.0-py3-none-any.whl Python 3 none any Details for oracle_oci_document_understanding_mcp_server-0.2.0-py3-none-any.whl

Total release size: 161.8 kB

Release files / oracle_oci_document_understanding_mcp_server-0.2.0.tar.gz

Download URL oracle_oci_document_understanding_mcp_server-0.2.0.tar.gz
Size 136.5 kB
Tags Source
SHA-256 checksum
How to use checksums
eefbdf320ef9f617b9c6910bd96665326a54856fc14fa85349b040193ac72249
BLAKE2b-256 checksum
How to use checksums
7f50ace9df9263ca1dfc195a262577e7b0a750747c29b00e6e35519cc19ec97e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Oracle Linux Server","version":"9.8","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / oracle_oci_document_understanding_mcp_server-0.2.0-py3-none-any.whl

Download URL oracle_oci_document_understanding_mcp_server-0.2.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd34c59a77c126e602465deddc23bbd5831f374328e921260351dc5ac75cafaf
BLAKE2b-256 checksum
How to use checksums
42e53ab31594ebabb46773011ae50ea62afde57f5e3c355bd7195058c7ab4a02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Oracle Linux Server","version":"9.8","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for oracle.oci-document-understanding-mcp-server 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page