Skip to content

feat(api): generate shared typed clients for Raycast and MCP #499

@JSONbored

Description

@JSONbored

Summary

API contracts already exist, and the repo can generate/validate OpenAPI. Raycast and MCP still carry their own parsing and response assumptions. Shared generated typed clients would reduce drift and make future backend changes safer.

Current state

  • API route contracts live in apps/web/src/lib/api/contracts.ts.
  • OpenAPI generation exists through scripts/generate-openapi.ts.
  • Raycast has defensive local parsers in integrations/raycast/src/feed.ts and jobs-feed.ts.
  • MCP has separate zod schemas for tool inputs/outputs.

Desired behavior

  • Generate a small shared client/schema package or artifact for public API response shapes consumed by Raycast and MCP.
  • Keep runtime parsing strict enough for untrusted public responses.
  • Make schema changes fail validation when clients drift.

Implementation notes

  • Avoid heavy generated code if a compact shared schema module is enough.
  • Prefer repo-local generated artifacts checked by --check commands.
  • Keep public package boundaries clean; do not make the published MCP package depend on private workspace-only code.

Acceptance criteria

  • API response shape changes are caught by client contract tests.
  • Raycast and MCP consume shared types/parsers where practical.
  • The published MCP package remains self-contained and publishable.
  • OpenAPI validation remains deterministic.

Validation

  • pnpm validate:openapi
  • pnpm test:mcp
  • npm test from the Raycast extension directory
  • Add or update focused unit tests for the touched API/helper surface.
  • Run the narrow relevant validation command for the changed package or route.
  • Run git diff --check before opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehelp wantedExtra attention is neededinfrastructuremcpModel Context Protocol package, API, endpoint, or content work.raycastRaycast extension, feed, and integration surfaces.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions