Skip to content

McpConfig

Typed snapshot of the mcp.* settings family.

Defaults here are read as fallbacks only — McpPlugin is what actually publishes them into Config via configDefault(), so an app that adds McpPlugin to its plugins key without further configuration still gets a sane, opt-in-safe setup (enabled = false).

final class McpConfig

SourceMcpConfig.php
ConstantValueDescription
AUTH_MODES['none', 'bearer', 'oauth2']The accepted values of mcp.auth.
PropertyTypeDescription
$authstringreadonly.
$discoverAttributesboolreadonly.
$discoveryCacheboolreadonly.
$enabledboolreadonly.
$exposeActionsboolreadonly.
$moduleDirsarrayreadonly.
$oauthAudience?``stringreadonly.
$oauthCacheTtlintreadonly.
$oauthIssuer?``stringreadonly.
$oauthJwksUri?``stringreadonly.
$oauthScopesSupportedarrayreadonly.
$pathstringreadonly.
$protocolVersionstringreadonly.
$serverNamestringreadonly.
$serverVersionstringreadonly.
$statelessboolreadonly.
$transportsarrayreadonly.

public function __construct(bool $enabled, list<string> $transports, string $path, string $protocolVersion, bool $stateless, string $serverName, string $serverVersion, string $auth, bool $exposeActions, list<string> $moduleDirs, bool $discoverAttributes, bool $discoveryCache, ?string $oauthIssuer, ?string $oauthAudience, ?string $oauthJwksUri, list<string> $oauthScopesSupported, int $oauthCacheTtl): mixed

ParameterTypeDescription
$enabledbool
$transportslist``<``string``>
$pathstring
$protocolVersionstring
$statelessbool
$serverNamestring
$serverVersionstring
$authstring
$exposeActionsbool
$moduleDirslist``<``string``>
$discoverAttributesbool
$discoveryCachebool
$oauthIssuer?``string
$oauthAudience?``string
$oauthJwksUri?``string
$oauthScopesSupportedlist``<``string``>
$oauthCacheTtlint

Returns mixed

MethodDescription
fromConfig(): McpConfigReads the whole mcp.* family out of Config into one immutable snapshot, applying the fallback defaults for anything the app (or McpPlugin) has not published.

public static function fromConfig(): McpConfig

Reads the whole mcp.* family out of Config into one immutable snapshot, applying the fallback defaults for anything the app (or McpPlugin) has not published.

Validation happens in the constructor, so a bad mcp.auth value or an oauth2 setup missing its issuer/audience fails here rather than at the first request.

Returns McpConfig

ThrowsWhen
QuioteExceptionif mcp.auth is not one of AUTH_MODES, or is oauth2 without mcp.oauth.issuer and mcp.oauth.audience.