Skip to content

SpecLoader ​

Rasuvaeff\Mcp\OpenApi\SpecLoader

Class — Rasuvaeff\Mcp\OpenApi — Source

Fetches the OpenAPI document over HTTP — for APIs that serve their spec from an endpoint (always current, no exported file to regenerate).

$headers is the SPEC fetch's own credential scope (spec_headers in params), deliberately separate from the operation calls' headers: when spec_path and base_url point at different origins, a shared header set would send the API's token to the spec host. A spec URL embedding credentials (userinfo) is rejected outright — such a URL ends up in diagnostics, logs and exception messages.

Methods ​

fromUrl() ​

php
fromUrl(string $url): SpecIndex