Skip to content

Add OCI Vision MCP server - #397

Open
antimverma wants to merge 5 commits into
oracle:mainfrom
antimverma:antverma/add-oci-vision-mcp
Open

Add OCI Vision MCP server#397
antimverma wants to merge 5 commits into
oracle:mainfrom
antimverma:antverma/add-oci-vision-mcp

Conversation

@antimverma

Copy link
Copy Markdown
Member

Description

Adds the OCI Vision MCP server under src/oci-vision-mcp-server.

This server provides stdio MCP tools for OCI Vision image analysis and related Object Storage image workflows, including image analysis, OCR, object detection, face detection, async image jobs, Object Storage upload/list/fetch, stored result lookup, and runtime configuration status.

The implementation follows the repository MCP server structure and public packaging expectations:

  • Adds pyproject.toml, uv.lock, README.md, CHANGELOG.md, LICENSE.txt, Containerfile, and oracle/ package source.
  • Exposes the package entry point as oracle.oci-vision-mcp-server.
  • Supports stdio transport only.
  • Uses OCI CLI-compatible session-token authentication only.
  • Documents that HTTP, streamable HTTP, OAuth, IDCS bearer-token validation, /mcp, and /.well-known/* endpoints are not exposed.
  • Adds OCI SDK additional_user_agent telemetry derived from package metadata.
  • Includes unit/integration tests with coverage threshold set to 90%.

Fixes: N/A

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Validated locally from src/oci-vision-mcp-server:

  • uv sync --locked --all-extras --dev
  • uv run pytest --cov=. --cov-branch --cov-report=term-missing
    • 236 passed, 2 skipped
    • Coverage: 91.31%
  • uv build
    • Successfully built sdist and wheel.
  • Wheel content inspection
    • Confirmed wheel metadata and console entry point are present.
    • Confirmed test files are excluded from the wheel.
  • MCP client smoke testing with Codex using the locally built wheel
    • Registered the server as a local stdio MCP server.
    • Verified detect_faces completed successfully on a local image.
    • Verified detect_text completed successfully on a local screenshot and returned OCR lines.
  • Best-practices validation
    • UPL headers present on Python source and Containerfile.
    • pyproject.toml metadata and entry point validated.
    • stdio-only behavior documented and tested.
    • OCI SDK additional user-agent derivation tested.

Test Configuration:

  • OS: macOS
  • Python: 3.13.2
  • Package manager: uv
  • MCP transport: stdio
  • OCI auth mode: OCI CLI-compatible session-token profile

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules (N/A)

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 28, 2026
@antimverma antimverma mentioned this pull request Jul 30, 2026
18 tasks

@dustin-sale dustin-sale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a substantial and well-tested new server, but I found three blockers before merge:

  1. get_resolved_config() requires profile, region, and default compartment globally, contradicting the documented defaults and blocking tools that do not need a Vision compartment.
  2. Image validation accepts formats and sizes OCI Vision does not support.
  3. OCI authentication bypasses the repository-required oracle-mcp-common authentication context.

Please also remove the coverage exclusions for the image-validation and Object Storage modules and add coverage for their safety-sensitive failure paths.

Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/config/settings.py Outdated
Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/config/consts.py Outdated
Comment thread src/oci-vision-mcp-server/pyproject.toml
Comment thread src/oci-vision-mcp-server/pyproject.toml
@antimverma
antimverma force-pushed the antverma/add-oci-vision-mcp branch from dc20332 to 556a17e Compare August 3, 2026 19:04
@antimverma

Copy link
Copy Markdown
Member Author

Hi @dustin-sale Thanks for the review, I have addressed all your comments. Please check.

@dustin-sale dustin-sale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes

  • authentication/session_signer.py:88 — [P1] Preserve profile-region fallback during 401 handling.
  • authentication/auth.py:124 — [P1] Propagate custom OCI config paths to session-repair commands.

Additional review notes

  • config/schemas.py:331 — [P2] Publish an accurate upload source schema.
  • config/settings.py:209 — [P3] Correct the auto-auth catalog default.

Validation

  • make lint passed.
  • make test project=oci-vision-mcp-server passed: 251 passed, 2 skipped, 90.86% coverage.
  • The two authentication edge failures were reproduced independently.

See the inline comments in this review for evidence, impact, and suggested remediation.

Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/config/schemas.py Outdated
Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/config/settings.py Outdated
@antimverma

Copy link
Copy Markdown
Member Author

HI @dustin-sale, addressed all the open comments. Please check.

@dustin-sale dustin-sale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes

  • authentication/auth.py:153 — [P1] Use the authentication config destination option.

Additional review notes

  • config/settings.py:198 — [P2] Align both catalog defaults with runtime defaults.

Validation

  • make lint and make test project=oci-vision-mcp-server passed; 252 tests passed, 2 skipped, with 90.77% coverage.
  • OCI CLI 3.90.0 parsing confirmed that --config-file does not populate the authentication destination.

See the inline comments in this review for evidence, impact, and suggested remediation.

Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/authentication/auth.py Outdated
Comment thread src/oci-vision-mcp-server/oracle/oci_vision_mcp_server/config/settings.py Outdated
@antimverma

Copy link
Copy Markdown
Member Author

@dustin-sale Addressed the open comments.

@antimverma
antimverma requested a review from dustin-sale August 5, 2026 16:47

@dustin-sale dustin-sale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous requested changes have all been addressed.

I am ready to approve once the dependencies are updated, see my comment.

Comment thread src/oci-vision-mcp-server/pyproject.toml Outdated
@antimverma
antimverma requested a review from dustin-sale August 5, 2026 19:03

@dustin-sale dustin-sale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. @gebhardtr will need to review as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants