Overview
OpenFGA provides Google Zanzibar-style relationship-based authorization for fine-grained access control. This guide covers deployment, configuration, and integration with your MCP Server.OpenFGA is the same authorization model used by Google, Airbnb, GitHub, and other companies handling billions of permission checks per day.
Architecture
Quick Start
1
Deploy OpenFGA
- Docker Compose
- Kubernetes
- Cloud Services
2
Verify Installation
3
Run Setup Script
4
Update Configuration
5
Test Authorization
Authorization Model
Default Model
The setup script creates this authorization model:Type Definitions
- User
- Organization
- Tool
- Conversation
user - Individual usersNo relations defined - users are leaf nodes in the authorization graph.
Configuration
Environment Variables
Client Configuration
Managing Relationship Tuples
Creating Relationships
Checking Permissions
Listing Permissions
Deleting Relationships
Production Deployment
High Availability
Deploy with multiple replicas:PostgreSQL Backend
Always use PostgreSQL in production (not in-memory):Performance Tuning
Monitoring
Backup & Recovery
Backup Tuples
Restore Tuples
Database Backup
Troubleshooting
Connection refused
Connection refused
Model not found
Model not found
Error:
authorization model not foundSolutions:Enable caching
OPENFGA_CHECK_QUERY_CACHE_ENABLED=true OPENFGA_CHECK_QUERY_CACHE_TTL=10sList all tuples for user
tuples = await client.read_tuples(user=“user:alice”) for t in tuples: print(f” → → “)Check specific relationship
allowed = await client.check_permission( user=“user:alice”, relation=“executor”, object=“tool:chat” )Verify tuple exists
all_tuples = await client.read_tuples() matching = [t for t in all_tuples if t[‘user’] == ‘user:alice’ and t[‘object’] == ‘tool:chat’] print(f”Matching tuples: “)Next Steps
Permission Model
Customize the authorization model
Relationship Tuples
Manage tuples programmatically
Authorization Guide
Learn authorization concepts
Keycloak Integration
Sync Keycloak roles to OpenFGA
Production Ready: OpenFGA provides enterprise-grade fine-grained authorization for your MCP server!