OpenFGA
An MCP server for managing authorization models with OpenFGA, an open-source authorization system.
Connect OpenFGA and Auth0 FGA to AI agents via the Model Context Protocol.
Use Cases
- Plan & Design - Design efficient authorization model using best practice patterns
- Generate Code - Generate accurate SDK integrations with comprehensive documentation context
- Manage Instances - Query and control live OpenFGA servers through AI agents
Quick Start
Offline Mode (Default)
Design models and generate code without a server:
{
"mcpServers": {
"OpenFGA": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--pull=always",
"evansims/openfga-mcp:latest"
]
}
}
}
Online Mode
Connect to OpenFGA for full management capabilities:
{
"mcpServers": {
"OpenFGA": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--pull=always",
"-e",
"OPENFGA_MCP_API_URL=http://host.docker.internal:8080",
"evansims/openfga-mcp:latest"
]
}
}
}
Safety: Write operations are disabled by default. Set
OPENFGA_MCP_API_WRITEABLE=trueto enable.
Docker Networking: For your
OPENFGA_MCP_API_URLusehost.docker.internalwhen running OpenFGA on your local machine, container names for Docker networks, or full URLs for remote instances.
Works with Claude Desktop, Claude Code, Cursor, Windsurf, Zed, and other MCP clients.
Configuration
MCP Transport
| Variable | Default | Description |
|---|---|---|
OPENFGA_MCP_TRANSPORT | stdio | Supports stdio or http (Streamable HTTP.) |
OPENFGA_MCP_TRANSPORT_HOST | 127.0.0.1 | IP to listen for connections on. Only applicable when using http transport. |
OPENFGA_MCP_TRANSPORT_PORT | 9090 | Port to listen for connections on. Only applicable when using http transport. |
OPENFGA_MCP_TRANSPORT_SSE | true | Enables Server-Sent Events (SSE) streams for responses. |
OPENFGA_MCP_TRANSPORT_STATELESS | false | Enables stateless mode for session-less clients. |
OpenFGA
| Variable | Default | Description |
|---|---|---|
OPENFGA_MCP_API_URL | OpenFGA server URL | |
OPENFGA_MCP_API_WRITEABLE | false | Enables write operations |
OPENFGA_MCP_API_STORE | Default requests to a specific store ID | |
OPENFGA_MCP_API_MODEL | Default requests to a specific model ID | |
OPENFGA_MCP_API_RESTRICT | false | Restrict requests to configured default store/model |
OpenFGA Authentication
| Authentication | Variable | Default | Description |
|---|---|---|---|
| Pre-Shared Keys | OPENFGA_MCP_API_TOKEN | API Token | |
| Client Credentials | OPENFGA_MCP_API_CLIENT_ID | Client ID | |
OPENFGA_MCP_API_CLIENT_SECRET | Client Secret | ||
OPENFGA_MCP_API_ISSUER | Token Issuer | ||
OPENFGA_MCP_API_AUDIENCE | API Audience |
See docker-compose.example.yml for complete examples.
Features
Management Tools
- Stores: Create, list, get, delete stores
- Models: Create models with DSL, list, get, verify
- Permissions: Check, grant, revoke permissions; query users and objects
SDK Documentation
Comprehensive documentation for accurate code generation:
- All OpenFGA SDKs (PHP, Go, Python, Java, .NET, JavaScript, Laravel)
- Class and method documentation with code examples
- Advanced search with language filtering
AI Prompts
Design & Planning
- Domain-specific model design
- RBAC to ReBAC migration
- Hierarchical relationships
- Performance optimization
Implementation
- Step-by-step model creation
- Relationship patterns
- Test generation
- Security patterns
Troubleshooting
- Permission debugging
- Security audits
- Least privilege implementation
Resources & URIs
openfga://stores- List storesopenfga://store/{id}/model/{modelId}- Model detailsopenfga://docs/{sdk}/class/{className}- SDK documentationopenfga://docs/search/{query}- Search documentation
Smart Completions
Auto-completion for store IDs, model IDs, relations, users, and objects when connected.
Related Servers
MCP Agentic Framework
An agentic communication framework for multi-agent collaboration using MCP.
SeedDream 3.0 FAL
Generate images using Bytedance's SeedDream 3.0 model via the FAL AI platform. Requires a FAL AI API key.
MCP迭代管理工具
An iteration management tool to automate the collection and submission of iteration information to a CodeReview system.
CircleCI
Enable AI Agents to fix build failures from CircleCI.
MetaMCP
A proxy server that combines multiple MCP servers into a single endpoint, routing requests to the appropriate underlying server.
Contract Inspector
Retrieve on-chain information for EVM contracts locally using an Ethereum RPC node and Etherscan API.
AI Develop Assistant
Assists AI developers with requirement clarification, module design, and technical architecture.
Make
Execute make targets from any Makefile in a safe and controlled environment.
Maven Tools
Access real-time Maven Central intelligence for fast and accurate dependency information.
MCP Proxy Server
A proxy server for aggregating and serving multiple MCP resource servers through a single endpoint.