Skip to content

GRANT ... --mcp is unreachable: the module-security read is routed to MCP and aborts before the PED write path (#704) #900

Description

@ynnckw

Summary

#704 shipped AddEntityAccessRule over PED, and mxcli mcp capabilities reports it as available. But every GRANT … --mcp fails before reaching that code, because the role-validation read is routed to the MCP backend instead of to -p.

Version: v0.18.0 (2026-08-14), Windows, Studio Pro 11.12.2.

Reproduction

Studio Pro open, MCP server enabled at Preferences → AI → MCP Server.

mxcli --mcp http://localhost:7782/mcp -p app.mpr \
  -c "GRANT MyModule.MyRole ON MyModule.MyEntity (READ (SomeAttr));"

Actual:

Error: failed to read module security for MyModule: GetModuleSecurity: not supported
by the MCP backend; run without --mcp to author against a local .mpr

Expected: the rule is added, as #704 describes and as mcp capabilities reports.

The role exists and is in the same module as the entity. Unchanged with --engine legacy. --mcp-verbose prints no PED tool call at all, so the abort happens before the write path is entered.

Why this may be worth separating from #704

mxcli mcp capabilities --mcp http://localhost:7782/mcp -p app.mpr prints, on the same binary and in the same session:

✓ Entity access rules (GRANT) — GRANT a NEW entity access rule for an existing role — the rule lives on DomainModels$Entity.accessRules (the domain-model document PED authors), NOT the security document. ADD-only: PED refuses to remove DomainModels$AccessRule / DomainModels$MemberAccess, so REVOKE and replacing an existing rule in place are rejected (edit in Studio Pro). The referenced module role must already exist

A capability report that contradicts the very next command is more costly than a missing feature, because it is the surface an agent consults before deciding which write path to take. Either the module-security read should come from -p (the role is a by-name reference that Studio Pro resolves anyway), or the capability should report itself as unavailable so the report stays trustworthy.

Workaround

Calling PED directly over HTTP JSON-RPC — ped_read_document / ped_update_document with documentType: "DomainModels$DomainModel" — works, because it avoids the module-security read entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions