Skip to content

Fixes 37271: move the MCP server to Java SDK 2.1.0 - #37273

Merged
Vishnuujain merged 5 commits into
mainfrom
upgrade-mcp-sdk
Nov 11, 2026
Merged

Vishnuujain merged 5 commits into
mainfrom
upgrade-mcp-sdk

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37271

  • Moves the MCP server from Java SDK 1.1.5 to 2.1.0. Replaces chore(deps): bump mcp-sdk.version from 1.1.5 to 2.1.0 #37066, which breaks the openmetadata-mcp test build.
  • Keeps what clients get the same: argument validation stays off, and tool schemas still leave out the tools.json doc keys (description, examples) that 1.x dropped.
  • A tool whose schema fails the new 2020-12 check is skipped and logged instead of taking down /mcp.

Companion Collate PR: https://github.com/open-metadata/openmetadata-collate/pull/8354. Merge the Collate PR first, then this one right after. Collate pins the SDK version, and this PR's code calls 2.x-only methods. Follow-ups are in #37274, stacked on this branch.

Type of change:

  • Improvement

High-level design:

  • One mcp-sdk.version in the root pom; Collate keeps a matching property.
  • McpUtils builds each tool with the 2.x builder and drops only description/examples from parameters (ADR:2026-11-06-mcp-tool-schemas-leave-out-the-tools-json-doc-keys).
  • validateToolInputs(false) keeps today's lenient argument handling.
  • addToolsToServer registers tools one by one, so one bad schema cannot take down the endpoint.

Merging #37066 as is breaks the build, and staying on 1.1.x means security patches only.

Tests:

Use cases covered

  • initialize still negotiates 2025-11-25; tools/list, tools/call and prompts/get behave as on 1.1.5.

Unit tests

  • McpSdkUpgradeTest: startup schema check over tools.json (with a broken-schema control), schema shape, and a bad tool being skipped. Two inputSchema().properties() call sites fixed for 2.x.
  • openmetadata-mcp module: 887/887 passed on 2.1.0. Coverage not measured.

Backend integration tests

Not run locally. The root pom change makes the planner pick the full suite, which runs in the merge queue.

Ingestion integration tests

Not applicable (no ingestion changes).

Playwright (UI) tests

Not run. The planner selects 21 canary specs only because the root pom changed; there is no UI change.

Manual testing performed

Local Collate server on this build, MCP over HTTP:

  1. initialize negotiates 2025-11-25.
  2. tools/list returns the same tools and schema keys as on 1.1.5.
  3. get_test_definitions with "limit": "3" (a string) still works; prompts/get works.
  4. A request with "id": null gets 400 (the 2.x SDK rejects it, as the MCP spec says).
  5. The log shows no MCP errors and no NoSuchMethodError.

UI screen recording:

Not applicable: backend dependency upgrade.

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: not applicable, no schema change.
  • 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 78209821644: no 🔴. 🟡 stale test comment fixed in 7c9d94ab994. 🟡 validateToolInputs(false) untested here: covered by looseArgumentsStillReachTheTool in the stacked PR.
  • Decision check: ADR:2026-11-06-mcp-tool-schemas-leave-out-the-tools-json-doc-keys.

Summary by Gitar

  • Content-Type enforcement:
    • POST /mcp with a non-JSON media type now returns 415 after authentication
  • Dynamic tool filtering:
    • Read-only and disabled-tool filters run per tools/list request, so setting changes apply without a restart
    • Server advertises listChanged: false since stateless servers cannot send notifications
  • Server info:
    • initialize reports mcpServerName and mcpServerVersion from MCP settings, with blank values falling back to defaults

This will update automatically on new commits.

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 6, 2026
@Vishnuujain
Vishnuujain marked this pull request as ready for review November 6, 2026 13:48
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

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
* 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
Vishnuujain requested a review from a team as a code owner November 11, 2026 10:23
@Vishnuujain
Vishnuujain enabled auto-merge (squash) November 11, 2026 10:38
@gitar-bot

gitar-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Upgrading the MCP SDK and requiring JSON POST requests could reject non-JSON clients or alter tool interoperability.

Moves the MCP server from Java SDK 1.1.5 to 2.1.0, with tool schemas still omitting the description and examples keys and a bad tool schema skipped and logged instead of failing /mcp. 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 merged commit 243b64d into main Nov 11, 2026
65 of 66 checks passed
@Vishnuujain
Vishnuujain deleted the upgrade-mcp-sdk branch November 11, 2026 11:00
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.

MCP: move to Java SDK 2.x

3 participants