The pattern
Model the MCP server’s surface in OpenFGA:- A
tooltype with acan_callrelation. user,group, androletypes so permissions can be granted directly, by group membership, or by role assignment.- Relationship tuples that grant specific users — or everyone via
user:*— access to specific tools.
- Identify the calling user.
- Call check against the requested tool.
- Allow or deny.
Simplified model
can_call accepts a public grant (user:*), a direct user, or any user assigned to a role — including users who are role assignees by way of group membership. The MCP server checks tool:search#can_call on every request, with the calling user as the subject.