DevStride auto-generates a fully typed frontend API client, public OpenAPI documentation, and the MCP server's SDK from the same backend Hono route definitions. This ensures the frontend SDK, published API docs, and MCP tool surface always match the backend — no manual sync needed.
ds script generate-api-client
registry in @/libs/interface-adapters/hono)x-skip-client.ds/tmp/openapi.jsonfrontend/src/api/ via @hey-api/openapi-tsThe generated SDK provides:
Run ds script generate-api-client after:
Add x-skip-client metadata directly on a route's config object so it's excluded from the generated frontend SDK (e.g., internal admin endpoints, webhook receivers):
// backend/src/modules/integrations/application/jira-webhook.hono.handler.ts
const route = {
'x-skip': true,
'x-skip-client': true,
method: 'post',
path: '/v1/organizations/integrations/jira/{accountId}/webhook',
summary: 'Jira Webhook Handler',
operationId: 'jiraWebhook',
tags: ['Integration'],
// ...
} satisfies RouteConfig;
ds script generate-api-docs
Generates a comprehensive OpenAPI 3.0.0 specification and writes it to:
backend/src/modules/api/interface-adapters/lambda/http/openapi.json
Routes marked x-skip or x-skip-client are excluded from this spec. The generated document includes a full quick-start guide baked into its info.description — API key creation, Basic Auth vs. the custom Authorization: apiKey=...&apiSecret=... header format, a first-call curl example, and a troubleshooting table for common 401/403 responses — plus the request/response schemas and tags for every included endpoint. The file is formatted with Prettier after being written so it stays diff-stable regardless of who regenerates it.
Two exclusion levels are available, both set as metadata on the route config object:
| Metadata | Effect |
|---|---|
x-skip | Excluded from documentation only; still appears in the API client SDK |
x-skip-client | Excluded from both documentation and the API client SDK |
Use x-skip for internal endpoints that developers need to call programmatically but shouldn't be in public docs. Use x-skip-client for endpoints that the frontend never calls (webhooks, healthchecks).
ds script generate-api-mcp
This command orchestrates the full generation chain needed to keep the DevStride MCP server (packages/mcp/) in sync with the backend API, in order:
generate-api-client — runs first and writes the canonical .ds/tmp/openapi.json (also regenerates frontend/src/api/* as a side effect)generate-api-docs — writes the public docs openapi.jsonpackages/mcp generate — runs packages/mcp/scripts/generate.ts, which consumes that same .ds/tmp/openapi.json and rewrites the generated MCP SDK under packages/mcp/src/devstride/gen/:
sdk.gen.ts — typed service classes from @hey-api/sdktypes.gen.ts — TypeScript typesschemas.gen.ts — per-component JSON Schemasoperations.gen.ts — per-operation { path?, query?, body? } JSON Schemascomponents.gen.ts — component schemas record used for Ajv $ref resolutionThese generated files are committed to git, so ds script generate-api-mcp is the one command to run after any backend OpenAPI change that should be reflected in the MCP server's tools.
generate-api-client and generate-api-docs separately before this — ds script generate-api-mcp always runs the full client → docs → MCP-gen chain itself.Understanding how a frontend API call reaches the backend helps when debugging:
Frontend SDK call
→ HTTP request to API Gateway
→ Lambda handler (Hono route)
→ Input validation
→ Command/Query constructed
→ CommandBus/QueryBus.execute()
→ Service handler (business logic)
→ Repository (database access)
→ Result<T, E> returned
→ Response formatted and sent
The code generators (ds g command <name> -m <module> and ds g query <name> -m <module>) scaffold this entire chain for a new command or query. The API client generator ensures the frontend matches the entry point.
ds CLI command listing