Repository navigation
feat(mcp): add read-only mode for the built-in MCP server - #36579
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved 2 closed / 2 findings🔴 High risk · The MCP read-only gate relies on tool annotations; a mutating tool marked read-only could still change metadata despite the setting. Adds an optional ✅ 2 closed✅ Quality: MCP_ALLOWED_TOOLS semantics are a new operator contract with no record
✅ Edge Case: Misspelled allowlist entries silently hide tools with no warning
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 |
|
Thanks for this @aidanradford! I pushed a couple of commits that turn it into a |
|
|



Describe your changes:
Fixes #36577
Type of change:
High-level design:
readOnlyto the MCP configuration (off by default), set from the MCP Server app settings. When on, only tools annotatedreadOnlyHint: trueare listed or callable, for every user including admins (admins skip policy checks, so a deny policy can't cover them). Each user's own permissions still apply to the remaining tools.tools/listafter a restart, and turning it off applies after a restart.describe_entity_typeis hidden too, since it only prepares acreate_entitycall.MCP_ALLOWED_TOOLSenv allowlist: read-only is what this issue and Feature request : read-only mode for the built-in MCP server #33323 ask for, and every tool already carriesreadOnlyHint. See ADR:2026-11-04-mcp-read-only-mode-hides-write-tools.Tests:
Use cases covered
describe_entity_type, and keeps the read tools.readOnlyHintcounts as a write tool.Unit tests
Files updated:
McpReadOnlyModeTest.java,useMcpConfiguration.test.tsx,McpApplicationConfiguration.test.tsx.mvn -pl openmetadata-mcp -am package -Dtest='org/openmetadata/mcp/**/*Test' -Dsurefire.failIfNoSpecifiedTests=falsepassed: 859 tests, 0 failures. Jest: 22 passed.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
On a local server: with the toggle on,
patch_entityreturned 403 right after saving; after a restarttools/listwent from 18 to 13 tools andcreate_entityreturnedUnknown tool; read tools kept working. Saving from the UI kept the other MCP settings.UI screen recording:
Screenshot below. Screen recording to follow.
Checklist:
Fixes #<issue-number>above.mcpConfiguration.jsongainsreadOnly; TypeScript types regenerated.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.