Repository navigation
Apply context memory visibility rules on MCP entity reads - #32465
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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 936 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 46m 26s ⏱️ Max setup 4m 27s · max shard execution 15m 36s · max shard-job elapsed before upload 19m 43s · reporting 7s 🌐 206.73 requests/attempt · 2.45 app boots/UI scenario · 5.02% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ ApprovedApplies context memory visibility rules to MCP entity reads, ensuring the same permission checks run on direct entity access as the REST API enforces. The check now sits in OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
|
picked to 2.0 here #32973 |



Background
What changed
get_entity_details— plain read,include=[content], and the multi-entity formcompany_context— reading one pill by namepatch_entity— its reply includes the entity, so the check runs before the writeCommonUtils.readEntityForCaller(...). One call fetches and checks, so a read path cannot skip it.owners. Without it the memory looks unowned, and its own owner would be turned away.company_contextby name answers for the person asking, instead of returning any shared pill. It also checks permissions against that pill, not just the entity type.New helpers in
ContextMemoryVisibilityenforceVisibility(entity, securityContext)— applies the rule for a memory, does nothing for other entity types, so callers need no type knowledge.hasVisibilityRules(entityType)— whether a type has a sharing setting at all.guardFields(entityType, fields)— adds the fields the check needs to a fetch.Tests
openmetadata-mcp: 594/594. Context memory and AI context suites inopenmetadata-service: 136/136.McpContextMemoryVisibilityITcovers the owner, an admin, another user, and someone the memory is shared with. Not run locally (needs a running server), so CI is its first run.Notes