Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
SourceFetcherBootloader.php1.32 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Source\Fetcher; use Butschster\ContextGenerator\SourceParserInterface; use Spiral\Boot\Bootloader\Bootloader; use Spiral\Core\Attribute\Singleton; use Spiral\Core\Container; #[Singleton] final class SourceFetcherBootloader extends Bootloader { /** @var class-string<SourceFetcherInterface>[] */ private array $fetchers = []; /** * Register a source fetcher * @param class-string<SourceFetcherInterface> $fetcher */ public function register(string $fetcher): self { $this->fetchers[] = $fetcher; return $this; } #[\Override] public function defineSingletons(): array { return [ SourceParserInterface::class => static function ( Container $container, SourceFetcherBootloader $bootloader, ) { $fetchers = $bootloader->getFetchers(); return new SourceFetcherProvider( fetchers: \array_map( static fn(string $fetcher) => $container->get($fetcher), $fetchers, ), ); }, ]; } public function getFetchers(): array { return $this->fetchers; } }

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/context-hub/generator'

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