Skip to content

342 fixes - #394

Open
JoseLuisC99 wants to merge 36 commits into
oracle:mainfrom
JoseLuisC99:342-fixes
Open

342 fixes#394
JoseLuisC99 wants to merge 36 commits into
oracle:mainfrom
JoseLuisC99:342-fixes

Conversation

@JoseLuisC99

@JoseLuisC99 JoseLuisC99 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Adds one unified, read-only OCI Database Observability MCP server for Operations Insights (OPSI) and Database Management (DBM).

  • Distribution and command: oracle.oci-db-observability-mcp-server
  • Python package: oracle.oci_db_observability_mcp_server
  • Source directory: src/oci-db-observability-mcp-server

The server supports STDIO and HTTP streaming transports, OCI authentication through oracle-mcp-common, and OCI IAM/IDCS request-token authentication for HTTP deployments.

Its MCP surface provides:

  • Compartment resolution through get_oci_compartment and list_oci_compartments
  • Catalog discovery through list_dbo_skills, list_dbo_tools, and describe_dbo_tool
  • Read-only OCI SDK invocation through invoke_dbo_tool

The catalog includes 34 workflow skills and 229 GET-backed OPSI/DBM operations. Operation schemas are aligned with the locked OCI Python SDK, validate arguments before client construction, and support pagination using nextPage.

Dependencies are declared in pyproject.toml:

  • fastmcp==3.4.5
  • oci==2.182.1
  • pydantic==2.13.4
  • jsonschema>=4.25.0,<5.0.0
  • oracle-mcp-common>=0.1.2,<0.2.0

Fixes #342

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

How Has This Been Tested?

  • uv run python -m compileall oracle
  • Verified the console entry-point module imports successfully.
  • uv run python -m pytest --cov=oracle.oci_db_observability_mcp_server --cov-branch --cov-report=term-missing oracle/oci_db_observability_mcp_server/tests
    • 39 tests passed
    • 91.48% coverage, with a 90% required threshold
  • make lint
  • git diff --check

Test Configuration:

  • Hardware: macOS arm64
  • Toolchain: Python 3.13.3, uv 0.6.17, pytest 9.0.3
  • SDK: OCI Python SDK 2.182.1, FastMCP 3.4.5

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have made corresponding documentation changes.
  • I have added tests that validate the server behavior.
  • New and existing unit tests pass locally with these changes.

Signed-off-by: José Luis Castro <jlcastrog99@gmail.com>
Signed-off-by: José Luis Castro <jlcastrog99@gmail.com>
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 24, 2026
@JoseLuisC99 JoseLuisC99 mentioned this pull request Jul 24, 2026
17 tasks
@JoseLuisC99

Copy link
Copy Markdown
Member Author

Hi @dustin-sale, any update?

@JoseLuisC99 JoseLuisC99 reopened this Jul 29, 2026
@dustin-sale

Copy link
Copy Markdown
Contributor

@JoseLuisC99 my apologies, I have not had a chance to get to this. Here are some initial changes that are needed:

  • Have each server under its own directory in /src. Makefile loops through /src and it wont account for nested mcp servers.
  • Add a CHANGELOG.md and README.md for each server.
  • We recently added oracle-mcp-common with common auth utils. We prefer that these are used to keep things consistent. Please see oci-cloud-mcp-server or oci-database-mcp-server for usage examples.

JoseLuisC99 and others added 8 commits July 29, 2026 12:17
Signed-off-by: José Luis Castro García <jose.lu.castro@oracle.com>
Signed-off-by: José Luis Castro García <jose.lu.castro@oracle.com>
Signed-off-by: José Luis Castro García <jose.lu.castro@oracle.com>
@JoseLuisC99

Copy link
Copy Markdown
Member Author

@dustin-sale everything is ready. We have modified our approach to align this MCP with our current agent engine and have significantly reduced the number of tools.

@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 implementation has a promising unified discovery surface and passes its unit-test/coverage gates, but it is not ready to merge.

  • PR description needs to be updated with the single oci-db-observability-mcp-server
  • Pagination is unusable for most catalog operations
  • Unit tests coverage gaps:
    • page-token preservation
    • strict schema parity
    • mutation isolation
  • The generic invocation tool also exposes state-changing DBM operations without a separate destructive boundary.
  • Most advertised “exact” schemas accept arbitrary or incorrectly typed arguments.
  • Documented uvx command does not match the published distribution

Please resolve those contract and safety issues and populate the changelog before another review.

Comment thread src/oci-oracle-db-observability-mcp-server/pyproject.toml Outdated
Comment thread src/oci-oracle-db-observability-mcp-server/CHANGELOG.md Outdated
@JoseLuisC99

Copy link
Copy Markdown
Member Author

Hi @dustin-sale, I have addressed your comments.

@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

  • src/oci-oracle-db-observability-mcp-server/oracle/oci_oracle_db_observability_mcp_server/metadata/tools.json:247 — [P1] Remove or gate state-changing operations from the read-only catalog.
  • Dependency updates in pyproject.toml.

Additional review notes

  • src/oci-oracle-db-observability-mcp-server/oracle/oci_oracle_db_observability_mcp_server/mcp.py:12 — [P2] Use the registered MCP tool names in discovery guidance.

Validation

  • make lint and make test project=oci-oracle-db-observability-mcp-server passed; 31 tests passed with 91.17% coverage.
  • The wheel builds and current CI is green, but a locked-SDK audit found five state-changing catalog operations marked mutable: false.

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

Comment thread src/oci-oracle-db-observability-mcp-server/pyproject.toml
@JoseLuisC99

Copy link
Copy Markdown
Member Author

Hi @dustin-sale, I have addressed your comments.

@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

No blocking changes requested.

Additional review notes

  • src/oci-oracle-db-observability-mcp-server/oracle/oci_oracle_db_observability_mcp_server/mcp.py:1 — [P2] Add the repository-required license headers.
  • src/oci-oracle-db-observability-mcp-server/oracle/oci_oracle_db_observability_mcp_server/metadata/skills.json:5 — [P2] Align skill descriptions with the remaining read-only tools.
  • src/oci-oracle-db-observability-mcp-server/pyproject.toml:12 — [P3] Refresh the PR description with the updated package dependencys in pyproject.toml.

Validation

  • Lint, lock validation, packaging, current CI, and all 39 tests pass with 91.48% coverage.
  • An independent locked-SDK audit confirms all 229 catalog operations are GET-only.

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

JoseLuisC99 and others added 2 commits August 14, 2026 16:51
Signed-off-by: José Luis Castro García <jose.lu.castro@oracle.com>

@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.

@JoseLuisC99 can you update the PR description to the single entry point and update the file directories to keep it consistent with the package name:

EX: src/oci-db-observability-mcp-server/oracle/oci_db_observability_mcp_server

  • removes 'oracle'

@JoseLuisC99

Copy link
Copy Markdown
Member Author

@dustin-sale fixed

@JoseLuisC99

Copy link
Copy Markdown
Member Author

Hi @dustin-sale, could you review the latest changes again? @jafetcc02 added some new tools required by a few clients. Btw, we’d like to get the remaining approvals, as there are some clients waiting for this MCP 😅

@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.

Review by @dustin-sale via Codex.

Requested changes

  • src/oci-db-observability-mcp-server/oracle/oci_db_observability_mcp_server/metadata/tools.json:15499 — [P1] Align the job-status scope with the pinned SDK.
  • src/oci-db-observability-mcp-server/oracle/oci_db_observability_mcp_server/metadata/tools.json:16403 — [P1] Enforce valid Monitoring interval and resolution values.

Additional review notes

  • tests/test_registry.py:150 — [P2] Restore SDK schema-parity coverage.
  • runtime.py:234 — [P2] Make max_results cap what it advertises.
  • metadata/database-and-infra-observability-metrics.json:39 — [P3] Correct the collection-interval field name.

Validation

  • make lint and make test project=oci-db-observability-mcp-server passed; 57 tests passed with 91.92% coverage.
  • Lock and package builds passed, but a corrected SDK-parity audit found one contract mismatch and git diff --check found an extra blank line at EOF.

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

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.

Comment from @dustin-sale via Codex.

[P1] Align the job-status scope with the pinned SDK

Evidence: OCI SDK 2.182.1's summarize_job_executions_statuses accepts id, managed_database_id, and managed_database_group_id, but not job_id; the generated method explicitly rejects unknown kwargs. The packaged schema currently accepts both job_id and calls with no resource scope, while invoke_registered_tool forwards those arguments directly to the SDK.

Impact: An agent following the advertised “exact” schema can submit a schema-valid call that fails locally instead of reaching OCI.

Requested change: Remove job_id, describe id as the SDK's job identifier, enforce exactly one of id, managed_database_id, or managed_database_group_id, and add regression coverage for accepted and rejected scope combinations.

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.

Comment from @dustin-sale via Codex.

[P1] Enforce OCI Monitoring interval constraints

Evidence: OCI Monitoring supports 1m60m, 1h24h, or 1d, and requires resolution to be no greater than the query interval. This pattern rejects valid 60m, accepts unsupported 2d9d, and runtime validation does not check the interval/resolution relationship.

Impact: Valid requests can be blocked by the MCP schema, while invalid schema-approved requests proceed to an avoidable OCI service failure.

Requested change: Accept the documented boundaries, reject durations above 1d, validate resolution <= interval before client creation, and test 60m, 1d, 2d, and inverted interval/resolution pairs.

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.

Comment from @dustin-sale via Codex.

[P2] Restore schema-parity coverage

Evidence: Existing OCI SDK entries intentionally omit kind and are treated as oci_sdk by the registry, but this condition treats a missing value as non-SDK and skips all 229 of them. The subsequent skill-name exclusion also skips the three standard Monitoring alarm bindings. A corrected audit immediately exposes the unsupported job_id contract.

Impact: This core regression test can pass without checking any of the established OCI SDK schemas.

Requested change: Use the registry default (tool.get("kind", "oci_sdk")), skip only metadata handlers and custom adapters, and either include standard alarm bindings in parity checks or add explicit assertions for any intentionally narrowed contracts.

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.

Comment from @dustin-sale via Codex.

[P2] Make max_results cap the advertised result

Evidence: response.data is a list of metric streams, and each stream contains its own aggregated_datapoints. Slicing only this outer list means max_results=1 may still return tens of thousands of nested datapoints. The full OCI response is also serialized before the slice occurs.

Impact: The parameter cannot reliably bound MCP response size or protect model context and local memory.

Requested change: Either rename this to max_streams and document its limitations, or cap nested datapoints as well and add a regression test using one stream with multiple datapoints.

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.

Comment from @dustin-sale via Codex.

[P3] Correct the collection-interval field name

Evidence: Every one of the 245 catalog records uses collectionInternal; no record exposes collectionInterval. These records are returned directly by the search, get, and list handlers.

Impact: Consumers receive a misleading field name for the metric collection cadence.

Requested change: Rename the field to collectionInterval consistently and add a catalog-shape test that locks the output contract.

[tool.hatch.build.targets.wheel]
packages = ["oracle"]
exclude = ["/oracle/**/tests/**"]

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.

My Codex review did not highlight this, but we recently added a [tool.hatch.build.targets.sdist] section that excludes a number of files not needed in the package source distribution. Please see oci-cloud-mcp-server/pyproject.toml#L38.

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.

Add Oracle DB Observability MCP servers for OPSI and DBM

3 participants