[MCP] Accept can_read in a file-defined access grant - #2030
Merged
wwidergoldpimcore merged 1 commit intoSep 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The change appears correct, but authorization-sensitive defaults warrant final maintainer review.
Pull request overview
Fixes YAML-defined MCP access grants so they support can_read, matching stored grants.
Changes:
- Adds
can_readwith a backward-compatibletruedefault. - Updates configuration tests and documentation.
- Covers both user and role grants through the shared configuration node.
The fix addresses the root cause at the configuration boundary, preserves existing behavior, and adds focused regression coverage.
File summaries
| File | Description |
|---|---|
src/DependencyInjection/Configuration.php |
Adds and documents can_read. |
tests/Unit/DependencyInjection/McpServersConfigurationTest.php |
Verifies explicit and default read grants. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The capability was added to the DTOs, hydrator and resolver but not to the config tree, so a YAML-defined server rejected the key its own settings-store form emits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ej6YARj6HakERFuERFuDF9
wwidergoldpimcore
force-pushed
the
fix/mcp-1309-config-can-read
branch
from
September 8, 2026 12:11
8187101 to
09c18a4
Compare
|
wwidergoldpimcore
approved these changes
Sep 8, 2026
wwidergoldpimcore
merged commit Sep 8, 2026
2966641
into
feature/mcp-1309-server-config-management
20 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



A file-defined MCP server cannot express
can_read, so defining one in YAML fails:0bf234f7introduced the capability across the DTOs, hydrator, schema and access resolver, but not in theconfiguration tree.
McpServerAccessEntry::fromMixed()readscan_readandtoArray()emits it, so thesettings-store form round-trips a grant the YAML equivalent then rejects. The two config locations disagree
about the same grant shape.
What this changes
Adds
can_readtomcpAccessGrantListNode(), defaulting to true rather than false like the other two.That matches
McpServerAccessEntry::fromMixed(), where the flag defaults to true and a bare string name is aread-only grant: naming someone without saying more lets them see the server. Defaulting it to false would
silently strip visibility from every existing file-defined grant.
The stale docblock describing the grid as
{name, can_access, can_edit}is corrected too.Verified
Unit suite green (889 tests), PHPStan clean. The existing
testSharedUsersAndRolesAcceptTheCapabilityGridencoded the old two-capability shape and is updated to the three-capability one, including the defaulting
behaviour for a grant that names someone and nothing else.
Checked against a running instance: a YAML-defined server with
can_readon its grants now validates, anddebug:configshows all three capabilities normalised per grant.🤖 Generated with Claude Code