Skip to content

refactor(cli): replace Zod with ArkType everywhere - #2729

Merged
riderx merged 7 commits into
mainfrom
chore/zod-to-arktype
Jul 22, 2026
Merged

refactor(cli): replace Zod with ArkType everywhere#2729
riderx merged 7 commits into
mainfrom
chore/zod-to-arktype

Conversation

@riderx

@riderx riderx commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Converted all Capgo CLI Zod schemas under cli/src/schemas/ to ArkType, matching the backend validation stack
  • Upgraded MCP from @modelcontextprotocol/sdk v1 to @modelcontextprotocol/server v2 beta so tools can register ArkType/Standard Schema inputSchema directly
  • Removed direct zod dependencies from root and CLI package.json (Zod may still appear transitively via MCP/knip)

Motivation (AI generated)

Backend validation already standardized on ArkType + Standard Schema. Keeping Zod only in the CLI duplicated dependencies and patterns. MCP SDK v2 accepts ArkType natively, so we can drop Zod from our direct dependency tree.

Business Impact (AI generated)

Smaller/simpler CLI dependency surface and one validation library across Capgo backend + CLI. MCP tool schemas stay LLM-friendly via ArkType .describe() metadata. Note: MCP server package is currently on a beta release.

Test Plan (AI generated)

  • bun run cli:lint
  • bun run cli:typecheck
  • bun run cli:build
  • MCP/upload CLI tests (test-upload-validation, test-mcp-live-update-onboarding, test-mcp-onboarding, test-mcp-build-tools, test-mcp-credentials-manage, test-mcp-oauth-reopen, test:mcp)
  • CI full suite
  • Smoke Capgo MCP server tool listing against a real client after merge

Generated with AI

Made with Cursor

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added Arktype-powered MCP input schemas, including live-update explain.
    • Introduced shared schema parsing helpers for consistent validation results and errors.
  • Bug Fixes
    • Improved validation error reporting with clearer, field-path-specific messages.
    • Standardized MCP tool/prompt registration to reliably enforce declared input schemas.
  • Refactor
    • Migrated CLI and MCP tool/prompt validation from Zod to Arktype and centralized shared schema definitions; updated MCP server wiring.
  • Tests
    • Updated MCP and validation tests to match the new registration and parsing APIs.
  • Documentation
    • None

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant