openfga-mcp

An experimental Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to read, search, and manipulate OpenFGA stores.

Visit Server
Added on 3/28/2025

OpenFGA MCP

An experimental Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to read, search, and manipulate OpenFGA stores. Unlocks authorization for agentic AI, and fine-grained vibe coding✨ for humans.

Built using the OpenFGA Python SDK and MCP Python SDK.

Quick Start

Requirements

  • Python 3.10+
  • OpenFGA

Installation

# Using pip/uv
uv pip install openfga-mcp

# From source
git clone https://github.com/evansims/openfga-mcp.git
cd openfga-mcp
make setup
source activate_venv.sh

Running

# Direct CLI usage
openfga-mcp-server --url "https://localhost:8000" --store "your-store-id"

# Using Make
make run

# With Docker
make docker-build
OPENFGA_API_URL="https://localhost:8000" OPENFGA_STORE_ID="your-store-id" make docker-run

Connecting

Connect your LLM application to the MCP server endpoint (default: http://localhost:8090).

Compatible with MCP clients including Cursor, Windsurf, Cline, Claude Desktop, and Zed.

Development

# Setup
make setup
source activate_venv.sh

# Common tasks (all run in virtual environment automatically)
make test        # Run tests
make lint        # Run linting
make type-check  # Run type checking
make check       # Run all checks

# Interactive development
make shell       # Start shell in virtual environment
make repl        # Start Python REPL
make ipython     # Start IPython REPL

# Run a custom command
make in-venv CMD="python -m openfga_mcp version"

Use Cases

  1. Dynamic Access Control: LLMs interpret natural language to determine permissions based on context
  2. Policy Management: Create or adjust authorization policies through conversational interfaces
  3. Explainable Authorization: Provide clear justifications for access decisions
  4. Policy Debugging: Diagnose permissions issues conversationally
  5. Secure Collaboration: Grant temporary access with precise scope

Documentation

For detailed documentation, run:

make docs-serve

Contributing

See Contributing Guidelines for more information.

License

Apache License 2.0 - see the LICENSE file for details.