evansims/openfga-mcp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

evansims/openfga-mcp

最新稳定版本:v2.0.0

Composer 安装命令:

composer require evansims/openfga-mcp

包简介

Query and administer OpenFGA and Auth0 FGA using AI agents.

README 文档

README

OpenFGA MCP Server

codecov Psalm Type Coverage

AI-powered authorization management for OpenFGA


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=true to enable.

Docker Networking: For your OPENFGA_MCP_API_URL use host.docker.internal when 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 stores
  • openfga://store/{id}/model/{modelId} - Model details
  • openfga://docs/{sdk}/class/{className} - SDK documentation
  • openfga://docs/search/{query} - Search documentation

Smart Completions

Auto-completion for store IDs, model IDs, relations, users, and objects when connected.

evansims/openfga-mcp 适用场景与选型建议

evansims/openfga-mcp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 9, 最近一次更新时间为 2025 年 07 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「authorization」 「security」 「Authentication」 「permissions」 「rbac」 「access-control」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 evansims/openfga-mcp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 evansims/openfga-mcp 我们能提供哪些服务?
定制开发 / 二次开发

基于 evansims/openfga-mcp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 37
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-07-07