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).
Synopsis
Section titled “Synopsis”final class McpConfig
| Source | McpConfig.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
AUTH_MODES | ['none', 'bearer', 'oauth2'] | The accepted values of mcp.auth. |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$auth | string | readonly. |
$discoverAttributes | bool | readonly. |
$discoveryCache | bool | readonly. |
$enabled | bool | readonly. |
$exposeActions | bool | readonly. |
$moduleDirs | array | readonly. |
$oauthAudience | ?``string | readonly. |
$oauthCacheTtl | int | readonly. |
$oauthIssuer | ?``string | readonly. |
$oauthJwksUri | ?``string | readonly. |
$oauthScopesSupported | array | readonly. |
$path | string | readonly. |
$protocolVersion | string | readonly. |
$serverName | string | readonly. |
$serverVersion | string | readonly. |
$stateless | bool | readonly. |
$transports | array | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”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
| Parameter | Type | Description |
|---|---|---|
$enabled | bool | |
$transports | list``<``string``> | |
$path | string | |
$protocolVersion | string | |
$stateless | bool | |
$serverName | string | |
$serverVersion | string | |
$auth | string | |
$exposeActions | bool | |
$moduleDirs | list``<``string``> | |
$discoverAttributes | bool | |
$discoveryCache | bool | |
$oauthIssuer | ?``string | |
$oauthAudience | ?``string | |
$oauthJwksUri | ?``string | |
$oauthScopesSupported | list``<``string``> | |
$oauthCacheTtl | int |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
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. |
fromConfig()
Section titled “fromConfig()”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
| Throws | When |
|---|---|
QuioteException | if mcp.auth is not one of AUTH_MODES, or is oauth2 without mcp.oauth.issuer and mcp.oauth.audience. |