Skip to content

feat(mcp): let admins disable individual MCP tools - #37165

Merged
Vishnuujain merged 2 commits into
mainfrom
mcp-disabled-tools
Nov 5, 2026
Merged

Vishnuujain merged 2 commits into
mainfrom
mcp-disabled-tools

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37161

  • Admins can now turn off single MCP tools in the MCP Server settings, on top of read-only mode. A disabled tool is refused right away for every user, admins included, and leaves tools/list after a restart.
  • The picker lists the tools the server actually registered (new admin-only GET /system/mcp/tools), so tools a distribution adds show up and the list doesn't go stale.

Note:

  1. the tool stop working the moment they are added in disabled list but show in tools list until the server is restarted
  2. if a restart happens after a tool is disabled, for re-enabling the tool we will need server restart

Recording Live:

Screen.Recording.2026-11-05.at.7.21.19.PM.mov

@Vishnuujain
Vishnuujain requested review from a team as code owners November 5, 2026 13:29
@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 5, 2026
@Vishnuujain Vishnuujain added the To release Will cherry-pick this PR into the release branch label Nov 5, 2026
@gitar-bot

gitar-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Adding a global MCP tool denylist changes access decisions; misconfiguration could block legitimate operations for every user, including admins.

Adds admin-controlled disabling of individual MCP tools in the MCP Server settings, alongside existing read-only mode. Disabled tools are refused for all users and omitted from tools/list after restart, and the picker is populated from the new admin-only GET /system/mcp/tools endpoint so distribution-added tools appear. 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

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.42% (138526/170135) 68.47% (49918/72902) 71.52% (28057/39228)

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@Vishnuujain
Vishnuujain merged commit 856e66e into main Nov 5, 2026
114 of 117 checks passed
@Vishnuujain
Vishnuujain deleted the mcp-disabled-tools branch November 5, 2026 17:37
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

gh-bot-collate Bot commented Nov 5, 2026

Copy link
Copy Markdown

🤖 Not backported to 2.0. Claude looked at the conflict and declined to resolve it:

Backport aborted: PR #37165 (feat(mcp): let admins disable individual MCP tools)

Reason

This PR is not a standalone change. It adds a disabledTools denylist that is
layered directly onto the read-only-mode feature shipped by PR #36579
("feat(mcp): add read-only mode for the built-in MCP server"), reusing that
feature's infrastructure end to end:

  • Backend: the new disabledTools field sits next to readOnly in
    mcpConfiguration.json, and McpServer.withoutDisabledTools() is wired
    into the same exposedTools() / refusalReason() methods that
    isReadOnlyMode() / isAvailableInReadOnlyMode() introduced.
  • Tests: the new assertions are added to the existing
    McpReadOnlyModeTest class.
  • Docs: the PR amends
    docs/decisions/2026-11-04-mcp-read-only-mode-hides-write-tools.md (the
    read-only-mode ADR) and cross-references it from the new ADR.
  • UI: the settings toggle is added to McpApplicationConfiguration.tsx /
    useMcpConfiguration.ts, the same components that render the read-only
    toggle.

I confirmed PR #36579 (commit a2c47f40bc) is not an ancestor of the
2.0 branch:

$ git merge-base --is-ancestor a2c47f40bc 2.0 && echo yes || echo no
no

and verified directly that 2.0 has none of the read-only-mode
scaffolding this PR depends on:

  • openmetadata-spec/.../mcpConfiguration.json on 2.0 has no readOnly
    property at all (the schema predates read-only mode).
  • McpServer.java on 2.0 has a bare getTools() with no RDF filtering,
    no exposedTools(), no isReadOnlyMode() / isAvailableInReadOnlyMode(),
    no refusalReason().
  • openmetadata-mcp/src/test/java/org/openmetadata/mcp/McpReadOnlyModeTest.java
    does not exist on 2.0.
  • useMcpConfiguration.ts and
    .../discovery/.../applications/McpConfigForm.tsx do not exist on 2.0
    (hence they show up as "deleted by us" in the cherry-pick conflict).
  • docs/decisions/2026-11-04-mcp-read-only-mode-hides-write-tools.md (the
    ADR this PR amends) does not exist on 2.0.

Why I didn't force a resolution

Porting only the "disable individual tools" slice would mean reimplementing
read-only mode's config field, server-side filtering/refusal logic, UI
toggle, and test scaffolding from scratch on 2.0 just to have something
for disabledTools to plug into — that is a second, unrelated feature
(PR #36579) smuggled in under this backport's title. That violates "port
this change and nothing else," and there's no way to adapt the hunks to
2.0's existing (much simpler) McpServer.getTools() without inventing
functionality 2.0 was never meant to have in this PR.

What to do instead

If 2.0 is meant to get per-tool disabling, backport PR #36579 (read-only
mode) first, merge that, then re-run this cherry-pick — at that point the
conflicts here should resolve the same way they did on main.

State left behind

The cherry-pick (git cherry-pick -x 856e66ed5f687c5d0962c2754d7a757181fc1814)
is still in progress with unresolved conflicts, exactly as the workflow
started it. No files were edited and nothing was staged or committed beyond
what git cherry-pick itself staged automatically for the non-conflicting
paths. Run git cherry-pick --abort to return the tree to a clean state.

resolver run

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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Admin Configuration to Enable/Disable Individual MCP Tools

3 participants