@kubb/mcp 5.0.0-beta.4 → 5.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -17
- package/dist/index.cjs +368 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.js +364 -162
- package/dist/index.js.map +1 -1
- package/package.json +18 -13
- package/src/index.ts +5 -2
- package/src/schemas/generateSchema.ts +11 -10
- package/src/schemas/initSchema.ts +7 -0
- package/src/schemas/validateSchema.ts +5 -0
- package/src/server.ts +42 -41
- package/src/tools/generate.ts +115 -178
- package/src/tools/init.ts +37 -0
- package/src/tools/validate.ts +28 -0
- package/src/types.ts +2 -1
- package/src/utils/formatDiagnostics.ts +29 -0
- package/src/utils/loadUserConfig.ts +32 -31
- package/src/utils/resolveUserConfig.ts +5 -20
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/README.md
CHANGED
|
@@ -1,26 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<img src="https://kubb.dev/og.png" alt="Kubb banner">
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
7
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
8
|
+
[![Coverage][coverage-src]][coverage-href]
|
|
9
|
+
[![License][license-src]][license-href]
|
|
10
|
+
[![Sponsors][sponsors-src]][sponsors-href]
|
|
11
|
+
|
|
12
|
+
<h4>
|
|
13
|
+
<a href="https://kubb.dev" target="_blank">Documentation</a>
|
|
14
|
+
<span> · </span>
|
|
15
|
+
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
16
|
+
<span> · </span>
|
|
17
|
+
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
|
|
18
|
+
</h4>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<br />
|
|
4
22
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This package provides an MCP server that exposes Kubb's code generation functionality through the [Model Context Protocol](https://modelcontextprotocol.io), allowing AI assistants like [Claude](https://claude.ai), [Cursor](https://cursor.sh), and other MCP-compatible clients to generate code from OpenAPI specifications using natural language.
|
|
23
|
+
# @kubb/mcp
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
### Model Context Protocol server for Kubb
|
|
10
26
|
|
|
11
|
-
|
|
27
|
+
MCP server for Kubb. Exposes code generation as a tool over the [Model Context Protocol](https://modelcontextprotocol.io) so AI assistants like [Claude](https://claude.ai), [Cursor](https://cursor.sh), and other MCP-compatible clients can generate TypeScript types, API clients, and more from OpenAPI specs using natural language.
|
|
12
28
|
|
|
13
|
-
|
|
14
|
-
- **Real-time Progress Notifications**: Stream build events and progress updates to the MCP client
|
|
15
|
-
- Uses `@kubb/core` build functionality directly
|
|
16
|
-
- Lightweight and focused on code generation
|
|
29
|
+
The server exposes a `generate` tool that runs a full Kubb build from a `kubb.config.ts`. It streams build events back to the client as real-time progress notifications. The server communicates over stdio and works with any MCP-compatible client.
|
|
17
30
|
|
|
18
31
|
## Installation
|
|
19
32
|
|
|
20
33
|
Install as a dev dependency:
|
|
21
34
|
|
|
22
|
-
```bash
|
|
23
|
-
|
|
35
|
+
```bash
|
|
36
|
+
bun add -D @kubb/mcp
|
|
37
|
+
# or
|
|
38
|
+
pnpm add -D @kubb/mcp
|
|
39
|
+
# or
|
|
40
|
+
npm install -D @kubb/mcp
|
|
24
41
|
```
|
|
25
42
|
|
|
26
43
|
> [!IMPORTANT]
|
|
@@ -48,7 +65,7 @@ This starts an MCP server that communicates via stdio (standard input/output), m
|
|
|
48
65
|
|
|
49
66
|
Add to your MCP client configuration (e.g., [Claude Desktop](https://claude.ai/download)'s `claude_desktop_config.json`):
|
|
50
67
|
|
|
51
|
-
|
|
68
|
+
Using `kubb mcp`:
|
|
52
69
|
|
|
53
70
|
```json
|
|
54
71
|
{
|
|
@@ -61,7 +78,7 @@ Add to your MCP client configuration (e.g., [Claude Desktop](https://claude.ai/d
|
|
|
61
78
|
}
|
|
62
79
|
```
|
|
63
80
|
|
|
64
|
-
|
|
81
|
+
Using the standalone package:
|
|
65
82
|
|
|
66
83
|
```json
|
|
67
84
|
{
|
|
@@ -99,7 +116,7 @@ Generate code from OpenAPI/Swagger specifications using Kubb configuration.
|
|
|
99
116
|
- `config` (string, optional): Path to kubb.config.ts file. If not provided, looks for kubb.config.ts in current directory
|
|
100
117
|
- `input` (string, optional): Path to OpenAPI/Swagger spec file (overrides config file setting)
|
|
101
118
|
- `output` (string, optional): Output directory path (overrides config file setting)
|
|
102
|
-
- `logLevel` (enum, optional): Control logging verbosity
|
|
119
|
+
- `logLevel` (enum, optional): Control logging verbosity, one of `'silent'`, `'info'`, `'verbose'` (default: 'info')
|
|
103
120
|
|
|
104
121
|
**Examples:**
|
|
105
122
|
|
|
@@ -152,3 +169,33 @@ export default defineConfig({
|
|
|
152
169
|
plugins: [pluginOas(), pluginTs(), pluginClient()],
|
|
153
170
|
})
|
|
154
171
|
```
|
|
172
|
+
|
|
173
|
+
## Supporting Kubb
|
|
174
|
+
|
|
175
|
+
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
|
|
176
|
+
|
|
177
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
178
|
+
- [See sponsorship tiers and our sponsors](https://kubb.dev/sponsors)
|
|
179
|
+
|
|
180
|
+
<p align="center">
|
|
181
|
+
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
182
|
+
<img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
|
|
183
|
+
</a>
|
|
184
|
+
</p>
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
[MIT](https://github.com/kubb-labs/kubb/blob/main/licenses/LICENSE-MIT)
|
|
189
|
+
|
|
190
|
+
<!-- Badges -->
|
|
191
|
+
|
|
192
|
+
[npm-version-src]: https://img.shields.io/npm/v/@kubb/mcp?flat&colorA=18181B&colorB=f58517
|
|
193
|
+
[npm-version-href]: https://npmjs.com/package/@kubb/mcp
|
|
194
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/mcp?flat&colorA=18181B&colorB=f58517
|
|
195
|
+
[npm-downloads-href]: https://npmjs.com/package/@kubb/mcp
|
|
196
|
+
[license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
|
|
197
|
+
[license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
|
|
198
|
+
[coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
|
|
199
|
+
[coverage-href]: https://www.npmjs.com/package/@kubb/mcp
|
|
200
|
+
[sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
|
|
201
|
+
[sponsors-href]: https://github.com/sponsors/stijnvanhulle/
|