Skip to content

McpDoctor ​

Rasuvaeff\Yii3Mcp\Doctor\McpDoctor

Class — Rasuvaeff\Yii3Mcp — Source

Health/readiness diagnostics for the MCP server configuration: runs a fixed set of checks in diagnosis order (root causes first) and returns an immutable DoctorReport. Backs the mcp:doctor console command.

Checks: endpoint secret configured (config), session directory usable and a session round-trip through the configured store (storage), OpenAPI spec loadable (config for a local file, upstream for a URL), server build (config). Network is touched only when explicitly requested (diagnose() with $probeUpstream = true) — with a URL spec the spec fetch AND the server build (which loads the spec eagerly) are skipped otherwise, so the base health check stays local.

Details never contain the configured secret or header VALUES, and any URL printed is stripped of userinfo credentials. Exception messages from application services are passed through (truncated) — a blanket "no secrets ever" promise is not enforceable over arbitrary third-party exceptions, so treat doctor output as operator-facing diagnostics, not something to hand to untrusted parties.

Methods ​

diagnose() ​

php
diagnose(bool $probeUpstream): Doctor\DoctorReport