Skip to content

fix(cli): expose MCP configuration diagnostics in doctor - #189

Merged
kingsword09 merged 2 commits into
mainfrom
fix/mcp-config-diagnostics
Oct 5, 2026
Merged

kingsword09 merged 2 commits into
mainfrom
fix/mcp-config-diagnostics

Conversation

@kingsword09

Copy link
Copy Markdown
Owner

zcode doctor previously showed runtime metadata without configuration diagnostics, and the launcher could reject broken settings before doctor ran. For example, a valid JSON file containing ui.theme: "system" can cause the runtime to ignore the user settings and omit its custom MCP servers.

This change makes that failure inspectable:

  • Add configuration paths, loaded/missing/invalid status, validated MCP names and sources, and field diagnostics to text output and the JSON configuration report.
  • Run doctor before first-run settings creation and provider migration, so it works without login and with malformed settings. Return exit code 1 for invalid configuration or skipped MCP entries.
  • Omit MCP connection values and JSON parse input fragments from the report. Inspect native configuration without starting MCP servers or sending model requests.
  • Document setting.json as this package's MCP configuration file, the separate provider schema, native MCP precedence, migration behavior, and upstream/Desktop path differences.

The report covers user/project configuration; plugin and built-in MCP servers are added at session startup. It does not test connectivity. MCP discovery and merge behavior remain unchanged.

Related to #188. This improves diagnosis of the reported symptom; the original reporter's environment-specific root cause is still unconfirmed.

Validation completed locally on macOS arm64:

  • bun run typecheck
  • bun run test:unit — 753 passed
  • bun test test/runtime/config-diagnostics.test.ts test/runtime/config-migration.test.ts test/runtime/launcher.test.ts — 15 passed
  • bun scripts/check-runtime.ts
  • Verified patch application and idempotency against the published 3.14.4-31 runtime.
  • Connected to the real Context7 HTTP MCP using the native runtime client and successfully called resolve-library-id and query-docs.

@kingsword09

Copy link
Copy Markdown
Owner Author

/pkg-pr-new

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

pkg-pr-new preview for commit e254fbbb85c772101c3fa136de29013264d1efe4.

npx --yes https://pkg.pr.new/zcode-app-cli@e254fbb

Full repository URL

This preview uses the selected commit. PR updates publish automatically after CI succeeds; kingsword09 can also request a preview with /pkg-pr-new.

Workflow logs

Preserve the doctor routing regression test and the platform-specific OAuth test description.
@kingsword09
kingsword09 merged commit aefd314 into main Oct 5, 2026
5 checks passed
@kingsword09
kingsword09 deleted the fix/mcp-config-diagnostics branch October 5, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant