A specialized MCP (Model Context Protocol) server that provides expert-level OpenFGA authorization modeling guidance. Get instant access to comprehensive OpenFGA knowledge directly in VS Code.
You can see it in action in this YouTube video.
No installation required! Connect directly to our hosted server:
- Enable Copilot in Visual Studio Code.
- Install the Visual Studio Code OpenFGA Extension. This will help Copilot validate its output by just monitoring the warnings emitted by the editor.
- Install the OpenFGA CLI. It will let the Agent run tests, verify the output, and fix them if needed.
brew install openfga/tap/fga - Enable Agent mode in Copilot. We had better results with Claude Sonnet 4 than with any other LLM.
Add this configuration to your VS Code MCP settings, or run the 'MCP Add Server' command and use the https://mcp.openfga.dev/mcp URL:
{
"mcpServers": {
"openfga-mcp": {
"url": "https://mcp.openfga.dev/mcp",
"type": "http",
"description": "OpenFGA Authorization Model Context Provider"
}
}
}Some possible prompts:
"Create an authorization model for a document management system"
"Create an authorization model for <Company Name>"
"Create an authorization model for <Website>"
"Add support for custom roles"
"Add support for temporary access at the document level"
"Split the model in modular models"
The server automatically provides expert context - no @mcp calls needed!
- 🚨 OpenFGA Expert Context: Mandatory guidance for all authorization modeling questions
- 🔍 Intelligent Detection: Automatically recognizes 31+ OpenFGA-specific patterns
- 📚 Expert Knowledge: 600+ lines of comprehensive OpenFGA modeling documentation
- 🔧 VS Code Native: Seamless GitHub Copilot integration
- Production URL: https://mcp.openfga.dev
- MCP Endpoint: https://omcp.openfga.dev/mcp
- Health Check: https://mcp.openfga.dev/health
- Protocol: MCP Streamable HTTP (2025-03-26)
# Health check
curl https://mcp.openfga.dev/health
# MCP endpoint test
curl -H "Accept: text/event-stream" \
https://mcp.openfga.dev/mcpThe server automatically triggers expert context for queries containing:
openfga,zanzibar,rebac,fgaauthorization model,auth model,access controlrelationship tuple,user relation objectpermission check,can user,access check
rbac,abac,permission,role basedattribute based,fine grained access controlrelationship based access control
openfga dsl,openfga schema,openfga relationsopenfga types,authorization tuple
Analyzes queries and returns relevant OpenFGA context.
Parameters:
query(string): The query to analyze for OpenFGA patterns
Example queries:
- "Create an authorization model for a document management system"
- "Add support for customer roles at the organization level"
- "Split the model in modules"
- "Add support for temporal access for documents"
Lists all available OpenFGA context prompts and their trigger patterns.
- Authorization Model Design - Complete guidance for creating OpenFGA models, DSL syntax, and type definitions
- Relationship Modeling - Expert patterns for defining user-object relationships and permissions
- Zanzibar Concepts - Deep understanding of Google's Zanzibar paper and ReBAC principles
- Testing & Validation - Best practices for testing authorization models and relationship tuples
If you want to run locally or contribute:
# Clone and setup
git clone https://github.com/aaguiarz/openfga-modeling-mcp.git
cd openfga-modeling-mcp
npm install
npm run build
# Development mode
npm run dev
# Enable debug logging
LOG_LEVEL=DEBUG npm run dev{
"mcpServers": {
"openfga-context": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/absolute/path/to/openfga-modeling-mcp"
}
}
}- Framework: Model Context Protocol (MCP) SDK
- Language: TypeScript with ES2022 target
- Transport: HTTP for production, STDIO for local development
- Pattern Engine: Custom rule-based OpenFGA query matching
- Logging: Structured logging with performance metrics
openfga-modeling-mcp/
├── src/
│ ├── index.ts # Main MCP server implementation
│ ├── prompt-matcher.ts # OpenFGA pattern matching engine
│ └── logger.ts # Comprehensive logging system
├── prompts/
│ └── authorization-model.md # OpenFGA expert guidance (600+ lines)
├── dist/ # Compiled JavaScript output
└── package.json # Project dependencies and scripts
MIT License - see LICENSE file for details
🚨 Note: This MCP server is exclusively designed for OpenFGA authorization modeling workflows and automatically provides expert guidance for all OpenFGA, Zanzibar, and ReBAC development questions.