doctor
Checks availability and path resolution of supported AI CLI binaries to confirm they are accessible for execution.
Instructions
Check supported AI CLI binary availability and path resolution. Does not verify login state or terms acceptance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/app/mcp.ts:488-494 (handler)The handleDoctor() method in ClaudeCodeServer class. It calls getCliDoctorStatus() and returns the result as JSON. This is the actual handler that executes when the 'doctor' tool is invoked.
private async handleDoctor(): Promise<ServerResult> { return { content: [{ type: 'text', text: JSON.stringify(getCliDoctorStatus(), null, 2) }] }; - src/app/mcp.ts:293-300 (registration)The tool registration in the ListTools handler. Defines the 'doctor' tool with its name, description, and empty input schema.
{ name: 'doctor', description: 'Check supported AI CLI binary availability and path resolution. Does not verify login state or terms acceptance.', inputSchema: { type: 'object', properties: {}, }, }, - src/app/mcp.ts:333-334 (registration)The CallToolRequest handler routing. Routes the 'doctor' tool name to the handleDoctor() method via a switch-case statement.
case 'doctor': return this.handleDoctor(); - src/cli-utils.ts:226-240 (helper)The getCliDoctorStatus() function that gathers status for all supported CLIs (claude, codex, gemini, forge, opencode). Each CLI is checked via getCliBinaryStatus which inspects availability, path resolution, and configured commands.
export function getCliDoctorStatus(): CliDoctorStatus { return { checks: { binaryAvailability: true, pathResolution: true, loginState: false, termsAcceptance: false, }, claude: getCliBinaryStatus('claude'), codex: getCliBinaryStatus('codex'), gemini: getCliBinaryStatus('gemini'), forge: getCliBinaryStatus('forge'), opencode: getCliBinaryStatus('opencode'), }; } - src/cli-utils.ts:32-44 (schema)Type definitions for CliDoctorStatus and CliBinaryStatus interfaces, defining the shape of the data returned by the doctor tool.
export interface CliDoctorStatus { checks: { binaryAvailability: boolean; pathResolution: boolean; loginState: boolean; termsAcceptance: boolean; }; claude: CliBinaryStatus; codex: CliBinaryStatus; gemini: CliBinaryStatus; forge: CliBinaryStatus; opencode: CliBinaryStatus; }