Repository navigation
Fixes 37248: MCP follow-ups after the Java SDK 2.x upgrade - #37274
Conversation
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 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 |
❌ 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 |
* 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
* 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 #37248
tools/listfollows read-only mode and disabled tools without a restart (SDKaddToolFilter). The server stops advertisinglistChanged, which a stateless server can never send./mcpanswers 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, andinitializereports the configured server name and version."5","true", an objectqueryFilter). 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:
initializereports the configuredmcpServerName/mcpServerVersion(defaultopenmetadata-mcp-server/1.0.0) instead of a hardcodedopenmetadata-mcp-stateless/1.1.0.listChangedisfalse.Content-Typegets 415.Type of change:
High-level design:
McpSyncListFilterreusesrefusalReasonagainst the liveMCPConfigurationon eachtools/list, andexecuteToolstill 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.Tests:
Use cases covered
tools/listreflects it without a restart.Unit tests
McpReadOnlyModeTest:tools/listthroughbuildServer, plus a live toggle with no restart.McpSdkUpgradeTest:listChangedfalse, loose arguments on the realsearch_metadataschema,serverInfofrom settings.HttpServletStatelessServerTransportTest: 415 for null, empty,text/plain, a look-alike andapplication/jsonx; charset allowed; 401 before 415.openmetadata-mcpmodule: 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).
CredentialMcpRevocationITonly 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:
initializegiveslistChanged: false, with server name and version from settings.PUT /api/v1/system/mcp/configwith read-only off:tools/listgoes from 13 to 18 tools, no restart. Disablingsemantic_searchdrops it, and a call to it gets 403.text/plainPOST gets 415,application/json; charset=utf-8gets 200, and a tokenless POST gets 401 withWWW-Authenticate.get_test_definitionswith"limit": "3"still works;prompts/getworks.UI screen recording:
Not applicable: backend behavior. The UI changes are setting help text only.
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.cbfd3e707db: no 🔴. Fixed in6d695644805: 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.