Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
ExceptionHandlerMiddleware.php809 B
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\McpServer\Middleware; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Spiral\Exceptions\ExceptionReporterInterface; final readonly class ExceptionHandlerMiddleware implements MiddlewareInterface { public function __construct( private ExceptionReporterInterface $reporter, ) {} public function process( ServerRequestInterface $request, RequestHandlerInterface $handler, ): ResponseInterface { try { return $handler->handle($request); } catch (\Throwable $e) { $this->reporter->report($e); throw $e; } } }

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