OpenFGA Modeling MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenFGA Modeling MCP ServerCreate an authorization model for a document management system"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenFGA Modeling MCP Server
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.
π Quick Start
No installation required! Connect directly to our hosted server:
1. Pre-requisites
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/fgaEnable Agent mode in Copilot. We had better results with Claude Sonnet 4 than with any other LLM.
2. Configure Your MCP Client
VS Code MCP Extensions
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"
}
}
}3. Start Using
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!
Related MCP server: Microsoft Style Guide MCP Server
π― Key Features
π¨ 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
MCP Server Hosting
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)
Test Connection
# Health check
curl https://mcp.openfga.dev/health
# MCP endpoint test
curl -H "Accept: text/event-stream" \
https://mcp.openfga.dev/mcpAutomatic OpenFGA Detection
The server automatically triggers expert context for queries containing:
Core OpenFGA Terms
openfga,zanzibar,rebac,fgaauthorization model,auth model,access controlrelationship tuple,user relation objectpermission check,can user,access check
Authorization Concepts
rbac,abac,permission,role basedattribute based,fine grained access controlrelationship based access control
Technical Implementation
openfga dsl,openfga schema,openfga relationsopenfga types,authorization tuple
οΏ½οΈ Available Tools
1. get_context_for_query
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"
2. list_available_contexts
Lists all available OpenFGA context prompts and their trigger patterns.
π Supported Context Areas
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
ποΈ Local Development (Optional)
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 devLocal VS Code Configuration
{
"mcpServers": {
"openfga-context": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/absolute/path/to/openfga-modeling-mcp"
}
}
}π¬ Technical Details
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
Project Structure
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π License
MIT License - see LICENSE file for details
π Related Resources
π¨ 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.
Available Tools
2 toolsget_context_for_queryB
Get relevant context prompt based on a query
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query to find context for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description only states the basic function without disclosing any behavioral traits such as behavior on empty results, timeout, destructive potential, or output format. For a tool with no annotations, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with no unnecessary content. Could be slightly more informative without losing conciseness, but currently efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given one parameter, no output schema, no annotations, and a sibling tool, the description is minimal. It lacks details on return format, error cases, or relationship to 'list_available_contexts'. Incomplete for practical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema's param description. Parameter is adequately documented by schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states action ('Get') and resource ('relevant context prompt'), and implies query-based filtering. However, it does not explicitly distinguish from sibling 'list_available_contexts', though the query parameter suggests a targeted retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage when a query is available and context is needed, but provides no explicit guidance on when not to use or how it differs from 'list_available_contexts'. No alternatives or prerequisites mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_available_contextsA
List all available context prompts and their descriptions
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It implies a read-only operation ('list'), but does not explicitly state safety traits. Adequate for a simple list tool, but lacks explicit behavioral detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single concise sentence with no extraneous information. Perfectly front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, no output schema), the description is complete. However, it does not mention the sibling tool or any additional context about the prompts.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, and schema coverage is 100%. Description adds value by specifying what is returned (descriptions). Baseline for zero-param tool is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb (list), resource (context prompts), and output (descriptions). It is specific enough for a tool with one sibling, but does not explicitly distinguish from get_context_for_query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus the sibling get_context_for_query. No context on prerequisites or scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.0- First observed
get_context_for_query - First observed
list_available_contexts
TDQS
Scored across 2 tools
Both tools have clearly distinct purposes: listing all contexts vs. getting a specific context based on a query. No overlap.
Both tools follow a consistent verb_noun pattern with underscores (list_available_contexts, get_context_for_query).
Two tools is on the low side but acceptable for a focused server that only needs to retrieve context prompts. It doesn't feel too sparse given the narrow domain.
The server only provides read operations (list and get). Missing create, update, delete operations for context prompts, which are likely needed for full lifecycle management.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn intelligent MCP server that serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices.4506MIT
- FlicenseNot gradedqualityDmaintenanceA professional MCP server for analyzing content against the official Microsoft Writing Style Guide, enabling style, grammar, terminology, and accessibility checks via AI tools like VS Code and GitHub Copilot.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that equips AI assistants with specialized, opinionated development playbooks for building microservices, frontends, databases, and DevOps pipelines. It integrates with clients like VS Code Copilot, Claude Desktop, and Cursor to provide battle-tested expertise.79MIT
- AlicenseNot gradedqualityAmaintenanceA production-ready MCP server that enables AI assistants to intelligently understand, analyze, edit, navigate, and review software projects with multi-workspace support, Git integration, and semantic search.1MIT