rbac
/rbac
Implement role-based access control in MCP servers by mapping token claims to internal roles. Use when building or reviewing MCP server authorization, permission models, or access control enforcement.
- Author
- redhatproductsecurity ↗
- Repository
- prodsec-skills ↗
- Licence
- Apache-2.0
- Last repository change
- 15.07.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 15.07.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Implement role-based access control in MCP servers by mapping token claims to internal roles. Use when building or reviewing MCP server authorization, permission models, or access control enforcement.
Original author description
Implement role-based access control in MCP servers by mapping token claims to internal roles. Use when building or reviewing MCP server authorization, permission models, or access control enforcement.
How it works
- Security Recommendation
- How It Works
- Example Token-to-Role Mapping
- Defense-in-Depth Value
- Implementation Checklist
SKILL.md preview
---
name: rbac
description: Implement role-based access control in MCP servers by mapping token claims to internal roles. Use when building or reviewing MCP server authorization, permission models, or access control enforcement.
category: "secure_development"
subcategory: "mcp-server"
---
# Role-Based Access Control (RBAC) for MCP Servers
## Security Recommendation
MCP servers SHOULD implement RBAC as a defense-in-depth layer by mapping token claims to internal application roles. This adds authorization beyond what OAuth scopes alone provide.
## How It Works
1. The IdP issues a token with claims (e.g., `roles`, `groups`, or custom claims)
2. The MCP server maps those claims to internal roles
3. Internal roles determine which tools and operations are available
## Example Token-to-Role Mapping
Token claim:
```json
{
"sub": "user-123",
"realm_access": {
"roles": ["mcp-admin", "data-reader"]
}
}
```
MCP server role mapping:
```yaml
rbac:
role_mappings:
admin:
token_claim: "realm_access.roles"
claim_value: "mcp-admin"
permissions: ["tools:*", "config:*"]
reader:
token_claim: "realm_access.roles"
claim_value: "data-reader"
permissions: ["tools:read", "resources:read"]
default:
permissions: ["tools:list"]
```
## Defense-in-Depth Value
| Layer | Control |
|---|---|
| **OAuth scopes** | What the token is authorized for (coarse-grained) |
| **RBAC roles** | What the user's role allows within the application (fine-grained) |
| **Tool-level checks** | What the specific tool permits for this role |
All three layers must agree for an operation to proceed.
## Implementation Checklist
- [ ] Define internal roles relevant to the MCP server (e.g., admin, operator, reader)
- [ ] Map IdP token claims (roles, groups, custom claims) to internal roles
- [ ] Enforce RBAC checks on every tool invocation alongside scope checks
- [ ] Default to the least-privileged role when no matching claim is found
- [ ] Log role-based authorization decisions (grants and denials)
- [ ] Document the role definitions and their permissions
- [ ] Regularly review and audit role assignments
Versions
The database has no other skills named rbac.
Database snapshot: 13.11.2026 · package version f8e6e7b8174d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 3 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100granola-enterprise-rbac
Enterprise role-based access control for Granola. Use when configuring user roles, setting permissions, or implementing access control policies. Trigger with phrases like "granola roles", "granola permissions", "granola access control", "granola RBAC", "granola admin". - 100linear-enterprise-rbac
Implement enterprise role-based access control with Linear. Use when setting up team permissions, implementing SSO, or managing access control for Linear integrations. Trigger with phrases like "linear RBAC", "linear permissions", "linear enterprise access", "linear SSO", "linear role management". - 100granola-enterprise-rbac
Configure enterprise role-based access control for Granola workspaces. Use when defining user roles, setting sharing permissions, configuring SSO group mappings, or implementing least-privilege access for meeting data. Trigger: "granola roles", "granola permissions", "granola… - 100laravel-permission
Use when implementing RBAC, role-based access control, or user authorization with Spatie Laravel Permission. - 100apollo-enterprise-rbac
Enterprise role-based access control for Apollo.io. Use when implementing team permissions, restricting data access, or setting up enterprise security controls. Trigger with phrases like "apollo rbac", "apollo permissions", "apollo roles", "apollo team access", "apollo enterprise security". - 100access-control
Design RBAC/ABAC models, Principle of Least Privilege, Identity Management. Use when: access control.