<?php
declare(strict_types=1);
namespace OpenFGA\MCP\Documentation;
use Throwable;
/**
* Singleton wrapper for DocumentationIndex to ensure single initialization.
*/
final class DocumentationIndexSingleton
{
private static ?DocumentationIndex $instance = null;
private function __construct()
{
// Private constructor to prevent direct instantiation
}
public static function getInstance(): DocumentationIndex
{
if (! self::$instance instanceof DocumentationIndex) {
self::$instance = new DocumentationIndex;
// Try to initialize eagerly
try {
self::$instance->initialize();
} catch (Throwable) {
// Initialization will happen on first use if it fails here
}
}
return self::$instance;
}
/**
* Reset the singleton instance (mainly for testing).
*/
public static function reset(): void
{
self::$instance = null;
}
}
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