Skip to main content

Doctor Command

Reference for copilot-setup doctor.

Usage

copilot-setup doctor

What it does

Probes every MCP server defined in ~/.copilot/mcp-config.json and reports health status.

Probe types

stdio servers: Launches the server process, sends a JSON-RPC initialize request with proper Content-Length framing (Content-Length: N\r\n\r\n{json}), waits for response with timeout.

HTTP servers: Sends an HTTP POST to the server URL with the initialize payload, checks response.

Status codes

StatusMeaning
okServer responded successfully to initialize
timeoutServer didn't respond within the timeout period
needs_oauthHTTP server returned 401 with WWW-Authenticate header
errorServer process failed to start or returned an error
not_foundServer command/binary not found on PATH

Output format

Each server gets a line with its name, transport type, and status. Color-coded: green for ok, yellow for needs_oauth, red for errors.

Tips

  • Run doctor after adding new MCP servers to verify they work
  • needs_oauth status means the HTTP server requires OAuth — see Troubleshooting for workarounds
  • Doctor reads the same mcp-config.json that the TUI uses