Repository navigation
Fixes 37271: move the MCP server to Java SDK 2.1.0 - #37273
Conversation
❌ PR checklist incompleteThis 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 |
* 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
Code Review ✅ Approved 🟡 Medium riskUpgrading 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 VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
* 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
Describe your changes:
Fixes #37271
openmetadata-mcptest build.tools.jsondoc keys (description,examples) that 1.x dropped./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:
High-level design:
mcp-sdk.versionin the root pom; Collate keeps a matching property.McpUtilsbuilds each tool with the 2.x builder and drops onlydescription/examplesfromparameters(ADR:2026-11-06-mcp-tool-schemas-leave-out-the-tools-json-doc-keys).validateToolInputs(false)keeps today's lenient argument handling.addToolsToServerregisters 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
initializestill negotiates2025-11-25;tools/list,tools/callandprompts/getbehave as on 1.1.5.Unit tests
McpSdkUpgradeTest: startup schema check overtools.json(with a broken-schema control), schema shape, and a bad tool being skipped. TwoinputSchema().properties()call sites fixed for 2.x.openmetadata-mcpmodule: 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:
initializenegotiates2025-11-25.tools/listreturns the same tools and schema keys as on 1.1.5.get_test_definitionswith"limit": "3"(a string) still works;prompts/getworks."id": nullgets 400 (the 2.x SDK rejects it, as the MCP spec says).NoSuchMethodError.UI screen recording:
Not applicable: backend dependency upgrade.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.78209821644: no 🔴. 🟡 stale test comment fixed in7c9d94ab994. 🟡validateToolInputs(false)untested here: covered bylooseArgumentsStillReachTheToolin the stacked PR.Summary by Gitar
/mcpwith a non-JSON media type now returns 415 after authenticationtools/listrequest, so setting changes apply without a restartlistChanged: falsesince stateless servers cannot send notificationsinitializereportsmcpServerNameandmcpServerVersionfrom MCP settings, with blank values falling back to defaultsThis will update automatically on new commits.