Skip to main content
Glama

OpenFGA MCP

project_structure.md3.46 kB
# Project Structure ## Root Directory ``` /Users/evan/Developer/evansims/openfga-mcp/ ├── bin/ │ └── openfga-mcp # Main executable entry point ├── src/ # Source code │ ├── Server.php # Main MCP server implementation │ ├── Helpers.php # Helper functions (includes isOfflineMode()) │ ├── OfflineClient.php # Offline mode client implementation │ ├── DebugLogger.php # Debug logging functionality │ ├── LoggingStdioTransport.php # Transport layer logging │ ├── LoggingToolWrapper.php # Tool execution logging │ ├── Tools/ # MCP Tools (executable functions) │ │ ├── AbstractTools.php │ │ ├── ModelTools.php │ │ ├── RelationshipTools.php │ │ └── StoreTools.php │ ├── Resources/ # MCP Resources (read-only data) │ │ ├── AbstractResources.php │ │ ├── DocumentationResources.php │ │ ├── ModelResources.php │ │ ├── RelationshipResources.php │ │ └── StoreResources.php │ ├── Templates/ # Resource templates │ ├── Prompts/ # AI prompt templates │ ├── Completions/ # Auto-completion providers │ ├── Models/ # Data models │ ├── Responses/ # Response formatting │ └── Documentation/ # Documentation indexing system ├── tests/ # Test suite ├── docs/ # SDK documentation ├── tools/ # Development tools ├── scripts/ # Utility scripts ├── .github/ # GitHub configuration │ └── workflows/ # CI/CD workflows ├── CLAUDE.md # AI assistant instructions ├── composer.json # PHP dependencies ├── phpstan.neon.dist # PHPStan configuration ├── psalm.xml.dist # Psalm configuration ├── .php-cs-fixer.dist.php # Code style configuration ├── rector.php # Rector configuration ├── Dockerfile # Production container └── docker-compose.*.yml # Docker configurations ``` ## Key Architectural Components ### Entry Point - `bin/openfga-mcp`: CLI entry point that loads autoloader and runs Server.php ### Core Classes - `Server.php`: Main server orchestration, handles MCP protocol - `OfflineClient.php`: Implements ClientInterface for offline mode - `Helpers.php`: Global helper functions ### Abstract Base Classes - `AbstractTools`: Base for all tool implementations (offline/permission checks) - `AbstractResources`: Base for all resource implementations ### MCP Implementation Pattern Each feature area (Store, Model, Relationship, Documentation) has: - A Tools class for actions (create, update, delete) - A Resources class for read operations - Optional Templates and Prompts classes ### Namespace Structure - Root namespace: `OpenFGA\MCP` - Test namespace: `OpenFGA\MCP\Tests` ## Environment Variables Configuration primarily through environment variables: - `OPENFGA_MCP_API_*`: API configuration - `OPENFGA_MCP_DEBUG`: Debug logging control ## Docker Architecture - Production image based on Alpine Linux - Multi-stage build for optimization - Supports both online and offline modes - Integration tests run in Docker environment

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/evansims/openfga-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server