Skip to main content

OCI Document Understanding MCP Server

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.1.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.1.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.1.0
File Size Uploaded Provenance Actions
oracle_oci_document_understanding_mcp_server-0.1.0.tar.gz 131.8 kB Without provenance Details for oracle_oci_document_understanding_mcp_server-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 156.9 kB

Release files / oracle_oci_document_understanding_mcp_server-0.1.0.tar.gz

Download URL oracle_oci_document_understanding_mcp_server-0.1.0.tar.gz
Size 131.8 kB
Tags Source
SHA-256 checksum
How to use checksums
25c91bf4ec0f23374f1566d98b05e13c60688f8ebfba0187ceb4fc6d2a957d14
BLAKE2b-256 checksum
How to use checksums
b15935b2051c072adfeadea392c1a9def1da7e38bfc661e2a325718684eaf269
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.1.0-py3-none-any.whl

Download URL oracle_oci_document_understanding_mcp_server-0.1.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cc20e20b5d65d86c44527374ddfb8fa4decda35ea7bb463e606ccd15dd06dae
BLAKE2b-256 checksum
How to use checksums
2a364e9d150b7d0ba2a09ded4dca24485e06009cc7c97460bd842fa29d200cd9
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.1.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