Skip to content

Fixes 37248: MCP follow-ups after the Java SDK 2.x upgrade - #37274

Merged
Vishnuujain merged 9 commits into
upgrade-mcp-sdkfrom
mcp-sdk-improvements
Nov 11, 2026
Merged

Vishnuujain merged 9 commits into
upgrade-mcp-sdkfrom
mcp-sdk-improvements

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37248

  • tools/list follows read-only mode and disabled tools without a restart (SDK addToolFilter). The server stops advertising listChanged, which a stateless server can never send.
  • /mcp answers 415 to a non-JSON POST, after auth, so a client without a token still gets the 401 that starts OAuth. Deprecated SDK calls are gone, and initialize reports the configured server name and version.
  • Argument validation stays off on purpose: tools coerce loose arguments ("5", "true", an object queryFilter). That is now recorded in an ADR.

Stacked on #37273; companion Collate PR https://github.com/open-metadata/openmetadata-collate/pull/8355. Items still open are in #37272.

Clients that follow the MCP spec will see three changes:

  • initialize reports the configured mcpServerName/mcpServerVersion (default openmetadata-mcp-server / 1.0.0) instead of a hardcoded openmetadata-mcp-stateless / 1.1.0.
  • listChanged is false.
  • A POST with a non-JSON Content-Type gets 415.

Type of change:

  • Improvement

High-level design:

  • Every tool is registered at startup. One McpSyncListFilter reuses refusalReason against the live MCPConfiguration on each tools/list, and executeTool still answers 403 on every call. The two ADRs are amended: ADR:2026-11-04-mcp-read-only-mode-hides-write-tools (v3) and ADR:2026-11-05-mcp-admins-can-disable-single-tools (v2).
  • buildServer(...) holds the builder chain, so tests run the same server clients reach.
  • The 415 check copies the SDK's own media-type rule into our transport (ADR:2026-11-06-mcp-post-requires-a-json-content-type).
  • Validation stays off: ADR:2026-11-06-mcp-tool-arguments-are-coerced-by-tools-not-validated-by-the-sdk.
  • Setting descriptions, the app form, the help page and the README no longer say "after a restart". The two generated TS files are regenerated with the repo's pinned quicktype.

Tests:

Use cases covered

  • An admin turns read-only on or off, or disables a tool, and the next tools/list reflects it without a restart.
  • A tokenless client still gets 401; an authenticated non-JSON POST gets 415.
  • Loose arguments still reach the tools.

Unit tests

  • McpReadOnlyModeTest: tools/list through buildServer, plus a live toggle with no restart.
  • McpSdkUpgradeTest: listChanged false, loose arguments on the real search_metadata schema, serverInfo from settings.
  • HttpServletStatelessServerTransportTest: 415 for null, empty, text/plain, a look-alike and application/jsonx; charset allowed; 401 before 415.
  • openmetadata-mcp module: 898/898 passed. Each new test was checked to fail with its production line reverted. Coverage not measured.

Backend integration tests

Not run locally (full suite selected; it runs in the merge queue). CredentialMcpRevocationIT only swaps one deprecated constructor.

Ingestion integration tests

Not applicable (no ingestion changes).

Playwright (UI) tests

Not run. The 30 specs selected come from help-text and generated-type changes; there is no UI behavior change.

Manual testing performed

Local Collate server on this build:

  1. initialize gives listChanged: false, with server name and version from settings.
  2. PUT /api/v1/system/mcp/config with read-only off: tools/list goes from 13 to 18 tools, no restart. Disabling semantic_search drops it, and a call to it gets 403.
  3. A misspelled disabled tool logs a warning at save time. Restoring the config logs "hide 5 of 18" and the list goes back to 13.
  4. An authenticated text/plain POST gets 415, application/json; charset=utf-8 gets 200, and a tokenless POST gets 401 with WWW-Authenticate.
  5. get_test_definitions with "limit": "3" still works; prompts/get works.

UI screen recording:

Not applicable: backend behavior. The UI changes are setting help text only.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: description text only, so no migration is needed.
  • For a UI feature or feature task: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    • Reviewed cbfd3e707db: no 🔴. Fixed in 6d695644805: the wrong "since 2.1.0", a missing 401-before-415 test, and a restart note for the server name and version. 🟡 no IT on the live-config wiring: checked live (step 2 above), and the per-call 403 still holds.
  • Decision check: the two ADRs above are added, and the two read-only and disabled-tools ADRs are amended.

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 6, 2026
@gitar-bot

gitar-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Live MCP tool filtering and JSON-only POST enforcement change client behavior; cached tool lists may lag, and non-JSON clients could be rejected.

Makes tools/list follow read-only mode and disabled-tool changes live without a restart, drops the listChanged capability, returns 415 for non-JSON POSTs to /mcp after auth, removes deprecated SDK calls, and reports the configured server name and version from initialize. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Vishnuujain
Vishnuujain marked this pull request as ready for review November 10, 2026 12:44
@Vishnuujain
Vishnuujain requested a review from a team as a code owner November 10, 2026 12:44
@Vishnuujain
Vishnuujain requested review from Rohit0301 and removed request for a team November 10, 2026 12:44
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@Vishnuujain
Vishnuujain added this pull request to stack #37486 November 10, 2026 12:44
@Vishnuujain
Vishnuujain removed this pull request from stack #37486 November 11, 2026 10:22
@Vishnuujain
Vishnuujain merged commit 95a16a2 into upgrade-mcp-sdk Nov 11, 2026
87 of 88 checks passed
@Vishnuujain
Vishnuujain deleted the mcp-sdk-improvements branch November 11, 2026 10:23
Vishnuujain added a commit that referenced this pull request Nov 11, 2026
* chore(mcp): upgrade java sdk to 2.1.0

* skip bad tool schemas

* fix test comment

* Fixes 37248: MCP follow-ups after the Java SDK 2.x upgrade (#37274)

* feat(mcp): update tools/list live when read-only or disabled tools change

* drop deprecated sdk calls

* reject non-json posts

* keep tool argument coercion

* record content-type rule

* clearer init failure log

* use configured server info

* pin 401 before 415
Vishnuujain added a commit that referenced this pull request Nov 11, 2026
* chore(mcp): upgrade java sdk to 2.1.0

* skip bad tool schemas

* fix test comment

* Fixes 37248: MCP follow-ups after the Java SDK 2.x upgrade (#37274)

* feat(mcp): update tools/list live when read-only or disabled tools change

* drop deprecated sdk calls

* reject non-json posts

* keep tool argument coercion

* record content-type rule

* clearer init failure log

* use configured server info

* pin 401 before 415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants