---
title: "Kubb"
description: "Define your API once and Kubb generates TypeScript types, clients, hooks, validators, and mocks from an OpenAPI specification."
canonical_url: "https://stijnvanhulle.be/projects/kubb"
---

> Index of every page on this site: [llms.txt](https://stijnvanhulle.be/llms.txt)

## What it is

Kubb is a framework for code generation. Define your API once with an OpenAPI or Swagger
specification, and Kubb generates the code around it: TypeScript types, clients,
data-fetching hooks, validators, and mock data. The core handles
parsing, the plugin graph, and file output, so each generator is a plugin you opt into
rather than a fixed pipeline.

## Why I built it

Hand-written API layers drift from the specification as soon as the back end changes.
Using the specification as the source of truth turns a renamed field or new endpoint into
a type error instead of a runtime surprise. The same specification can also drive types,
a React Query layer, Zod schemas, and Faker mocks from one config.

## Plugins

Kubb ships official plugins for TypeScript types, Axios and fetch clients, TanStack
Query for React and Vue, SWR, Zod validation, Faker mock data, and MSW handlers. An MCP
plugin exposes the generator to AI agents over the Model Context Protocol. You compose the
ones you need in a single `kubb.config.ts`, and the core resolves them into one generation
pass.

```bash
npx kubb generate
```

See the [documentation](https://www.kubb.dev) for the full plugin list and config
reference.

## Sitemap

See the full [sitemap](https://stijnvanhulle.be/sitemap.md) for all pages.
