Add the MCP doctor subcommand with text and JSON output, config-only mode, and scope filtering so users can diagnose MCP issues from the CLI. Co-Authored-By: Claude <noreply@anthropic.com>
20 lines
633 B
TypeScript
20 lines
633 B
TypeScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
|
|
import { Command } from '@commander-js/extra-typings'
|
|
|
|
import { registerMcpDoctorCommand } from './doctorCommand.js'
|
|
|
|
test('registerMcpDoctorCommand adds the doctor subcommand with expected options', () => {
|
|
const mcp = new Command('mcp')
|
|
|
|
registerMcpDoctorCommand(mcp)
|
|
|
|
const doctor = mcp.commands.find(command => command.name() === 'doctor')
|
|
assert.ok(doctor)
|
|
assert.equal(doctor?.usage(), '[options] [name]')
|
|
|
|
const optionFlags = doctor?.options.map(option => option.long)
|
|
assert.deepEqual(optionFlags, ['--scope', '--config-only', '--json'])
|
|
})
|