Skip to content

[2.0] Fixes 37687: Disabling the MCP Server app stops MCP without a restart - #37727

Merged
Vishnuujain merged 1 commit into
2.0from
backport/2.0/pr-37704
Nov 13, 2026
Merged

Vishnuujain merged 1 commit into
2.0from
backport/2.0/pr-37704

Conversation

@gh-bot-collate

Copy link
Copy Markdown

Automated backport of #37704 to 2.0.

Source PR #37704
Author @Vishnuujain
Merge commit 20b4252f08262ace9ae142a6ef7d4192c435a39a
Method Conflicts resolved by Claude — worth a read of the diff.

Resolution notes

Backport notes: PR #37704 → 2.0

Fixes #37687: disabling the MCP Server app (or flipping mcpConfiguration.enabled off) now stops
MCP routes without a server restart, instead of only soft-deleting the app while the routes kept
answering.

Conflicts and how they were resolved

openmetadata-mcp/.../McpServer.java

Conflict was only in the import block. Main's version of this file has diverged a lot (dynamic
tool/list-filter registry, McpStatelessServerTransport, McpSyncListFilter, etc.) that 2.0 does
not have. Of the two imports the source PR actually added (jakarta.servlet.DispatcherType,
java.util.EnumSet), both are used by the new registerAvailabilityFilter method, so both were
kept; McpStatelessServerTransport was main-only pre-existing code unrelated to this PR, so it was
left out. The rest of the PR's changes (the registerAvailabilityFilter call and method, and the
SAML callback availability check) applied cleanly — 2.0's narrower addToolsToServer (no
try/catch skip-on-bad-schema logic) was left untouched since that's an unrelated main-only
addition.

openmetadata-mcp/.../usage/McpUsageRecorder.java

2.0 still has a 3-arg backwards-compatible record(...) overload that was already removed from
main before this PR (unrelated prior cleanup). Cherry-pick conflicted because the PR's new Javadoc
for resolveMcpApp() landed right where that overload sits on 2.0. Resolution keeps both: the
pre-existing 3-arg overload (untouched, since dropping it is out of scope for this backport) and
the PR's new resolveMcpApp() implementation (reads the app via
Entity.findEntityByNameOrNull(Entity.APPLICATION, McpAppConstants.MCP_APP_NAME, Include.ALL)
instead of ApplicationContext), plus its explanatory Javadoc.

Other files

Everything else in the PR (McpAvailabilityFilter.java, the OAuthWellKnownFilter.java discovery
path gating, McpUsageResource.java's resolveMcpApp(), the ADR doc, and the updated unit tests)
applied cleanly with git cherry-pick and needed no manual changes. Checked each new/changed
symbol against 2.0 (Entity.findEntityByNameOrNull, SecurityConfigurationManager.getCurrentMcpConfig,
MCPConfiguration, McpAppConstants.MCP_APP_NAME, the system/mcp/config and mcp/usage/summary
REST paths) — all exist on 2.0.

One extra change beyond the conflict: McpTestBase.java

The new integration test McpAvailabilityIT.java calls a putResponse(path, body, token) helper
that exists on main's McpTestBase.java but not on 2.0's (added there by some other, not-yet-backported
main commit, unrelated to this PR). Without it the new test does not compile. Added the same
putResponse helper (identical to main's) to 2.0's McpTestBase.java, next to the existing
deleteResponse/postResponse helpers, as the minimal enabler for the ported test — no other
behavior in that file was touched.

Please double-check

  • The McpServer.java import resolution: confirm McpStatelessServerTransport really isn't needed
    on 2.0 (it was unused in the file both before and after this change).
  • The McpUsageRecorder.java resolution: confirm 2.0 is meant to keep the 3-arg record(...)
    overload (it predates this PR and is unrelated to it, so it was preserved as-is).
  • The added putResponse in McpTestBase.java — straight port of main's existing helper, no logic
    changes.

Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #37704 is asked to look.

resolver run

…#37704)

* fix(mcp): disable turns off mcp without restart

* usage recorder fix

* usage endpoints fix

* public gate methods

(cherry picked from commit 20b4252)
@gh-bot-collate
gh-bot-collate Bot requested a review from a team as a code owner November 13, 2026 06:49
@gh-bot-collate
gh-bot-collate Bot requested review from yan-3005 and removed request for a team November 13, 2026 06:49
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 13, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.0 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@Vishnuujain
Vishnuujain merged commit a7930f1 into 2.0 Nov 13, 2026
70 of 81 checks passed
@Vishnuujain
Vishnuujain deleted the backport/2.0/pr-37704 branch November 13, 2026 08:30
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