@runpod/mcp-server 1.4.0 → 2.0.0
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/CHANGELOG.md +43 -0
- package/README.md +173 -53
- package/dist/chunk-ZP3TCVXG.mjs +2116 -0
- package/dist/chunk-ZP3TCVXG.mjs.map +1 -0
- package/dist/http.cjs +1545 -589
- package/dist/http.cjs.map +1 -1
- package/dist/http.mjs +2 -2
- package/dist/stdio.cjs +1619 -593
- package/dist/stdio.cjs.map +1 -1
- package/dist/stdio.mjs +1619 -593
- package/dist/stdio.mjs.map +1 -1
- package/dist/tools.cjs +1545 -587
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +51 -3
- package/dist/tools.d.ts +51 -3
- package/dist/tools.mjs +1 -1
- package/package.json +3 -2
- package/dist/chunk-D4AEYJ2O.mjs +0 -1160
- package/dist/chunk-D4AEYJ2O.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @runpod/mcp-server
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 2658e43: **Breaking:** default the REST version to **v2**, and migrate Serverless
|
|
8
|
+
endpoint CRUD to the v2 API.
|
|
9
|
+
|
|
10
|
+
With nothing set, all control-plane resources now use the v2 REST API
|
|
11
|
+
(`v2-rest.runpod.io/v2`); set `RUNPOD_REST_VERSION=v1` to pin the previous v1
|
|
12
|
+
behavior.
|
|
13
|
+
|
|
14
|
+
Why this is a major bump: `create-endpoint`/`update-endpoint` move from the v1
|
|
15
|
+
**template-based** model to the v2 **inline-config** model. On v2,
|
|
16
|
+
`create-endpoint` no longer accepts a `templateId` — it requires `imageName` +
|
|
17
|
+
`gpuPoolIds` (GPU pool names from `list-gpu-types`, e.g. `AMPERE_80`) plus
|
|
18
|
+
optional `workers`/`scaling`. So an existing integration that calls
|
|
19
|
+
`create-endpoint` with `{ templateId }` and no `RUNPOD_REST_VERSION` pin will
|
|
20
|
+
get a clean `400` after upgrading, with no code change on their side. To keep
|
|
21
|
+
the old behavior, pin `RUNPOD_REST_VERSION=v1` (templateId model preserved).
|
|
22
|
+
|
|
23
|
+
`jobs` still resolves to v1 (serverless runtime API, no v2 home). CPU pods are
|
|
24
|
+
still served by v1, and the `auto` stdio probe is unchanged. Version-sensitive
|
|
25
|
+
tests pin their version explicitly so the suite is independent of the default.
|
|
26
|
+
|
|
27
|
+
See the README "REST API version (v1 / v2)" section for the migration note.
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- cdba19c: Add v2-only tools covering the rest of the v2 REST surface:
|
|
32
|
+
- **Tags** — `list-tags`, `get-tag`, `create-tag`, `update-tag`, `delete-tag`,
|
|
33
|
+
and `attach-tag` / `detach-tag` to associate a tag with a pod, network volume,
|
|
34
|
+
cluster, or serverless endpoint.
|
|
35
|
+
- **Billing** — `get-billing` returns time-bucketed spend, either aggregated or
|
|
36
|
+
broken down by resource type (`scope`), windowed by `startTime`/`endTime` or
|
|
37
|
+
`lastN`. The records array is capped via `limit`/`cursor`.
|
|
38
|
+
- **Endpoint workers** — `list-endpoint-workers` lists the workers behind a
|
|
39
|
+
serverless endpoint plus an aggregate summary (capped via `limit`/`cursor`).
|
|
40
|
+
- **Catalog by id** — `get-cpu-type` and `get-data-center` round out the catalog
|
|
41
|
+
alongside the existing `get-gpu-type`.
|
|
42
|
+
|
|
43
|
+
These resources exist only on the v2 REST API, so each returns a clean `501`
|
|
44
|
+
notice on v1 (set `RUNPOD_REST_VERSION=v2`).
|
|
45
|
+
|
|
3
46
|
## 1.4.0
|
|
4
47
|
|
|
5
48
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,33 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://smithery.ai/server/@runpod/runpod-mcp-ts)
|
|
4
4
|
|
|
5
|
-
This is the official Runpod Model Context Protocol (MCP) server, published to npm as `@runpod/mcp-server`.
|
|
5
|
+
This is the official Runpod Model Context Protocol (MCP) server, published to npm as `@runpod/mcp-server`. It lets MCP clients such as Claude Code, Claude Desktop, Cursor, Windsurf, and VS Code manage your Runpod Pods, Serverless endpoints, templates, network volumes, and more.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Quick start
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- Hosted Streamable HTTP for Vercel or other HTTP-capable platforms. Each request carries its own `Authorization: Bearer <token>`, which the server forwards directly to the Runpod API. The token can be a Runpod API key or one obtained through the OAuth "Sign in with Runpod" flow.
|
|
9
|
+
The fastest way to get connected is the guided installer pointed at the **hosted Runpod MCP server at `https://mcp.getrunpod.io/`**. The installer detects the agents you have installed, asks which ones to configure, and writes the configuration for you:
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npx @runpod/mcp-server@latest add
|
|
13
|
+
```
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
It supports **Claude Code, Claude Desktop, Cursor, Windsurf, and Visual Studio Code**, and offers two connection modes:
|
|
15
16
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
17
|
+
- **Hosted (recommended).** Points the agent at the hosted server and authenticates with the **"Sign in with Runpod"** OAuth flow, so **no API key is stored on disk**.
|
|
18
|
+
- **Local.** Runs the server through `npx` and stores a `RUNPOD_API_KEY` in the agent's config.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
To undo the changes later, run:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @runpod/mcp-server@latest remove
|
|
24
|
+
```
|
|
20
25
|
|
|
21
|
-
###
|
|
26
|
+
### Connect to the hosted server manually
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
If you'd rather configure your client by hand, point it at the hosted server over HTTP (no local process, no API key stored).
|
|
29
|
+
|
|
30
|
+
**Claude Code** — add it as an HTTP server:
|
|
24
31
|
|
|
25
32
|
```bash
|
|
26
|
-
|
|
33
|
+
claude mcp add --transport http runpod -s user https://mcp.getrunpod.io/
|
|
27
34
|
```
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
**Other clients** (Cursor, VS Code, Claude Desktop connectors, …) — use a URL-based MCP entry:
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"runpod": {
|
|
42
|
+
"url": "https://mcp.getrunpod.io/"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The hosted server uses the "Sign in with Runpod" OAuth flow for authentication, so no API key is stored. An OAuth-capable client starts the sign-in flow automatically on first connect. See [Sign in with Runpod (authorize flow)](#sign-in-with-runpod-authorize-flow) for details.
|
|
49
|
+
|
|
50
|
+
> Prefer your own API key instead of OAuth? Append `--header "Authorization: Bearer YOUR_API_KEY"` to the `claude mcp add` command (or add a `headers` block in the JSON), and the server forwards that key to the Runpod API directly.
|
|
51
|
+
|
|
52
|
+
### Requirements
|
|
53
|
+
|
|
54
|
+
- Node.js 18 or higher.
|
|
55
|
+
- A Runpod account and API key: https://www.runpod.io/console/user/settings
|
|
56
|
+
|
|
57
|
+
## Run locally with `npx`
|
|
58
|
+
|
|
59
|
+
To run the server as a local `stdio` process with your own API key:
|
|
32
60
|
|
|
33
61
|
```bash
|
|
34
62
|
RUNPOD_API_KEY=YOUR_API_KEY npx -y @runpod/mcp-server@latest
|
|
@@ -40,9 +68,9 @@ RUNPOD_API_KEY=YOUR_API_KEY npx -y @runpod/mcp-server@latest
|
|
|
40
68
|
npx -y @smithery/cli install @runpod/runpod-mcp-ts --client claude
|
|
41
69
|
```
|
|
42
70
|
|
|
43
|
-
## Local MCP
|
|
71
|
+
## Local MCP client setup
|
|
44
72
|
|
|
45
|
-
Local MCP clients should use the default package entrypoint, which is the `stdio` server.
|
|
73
|
+
Local MCP clients should use the default package entrypoint, which is the `stdio` server. The caller sets `RUNPOD_API_KEY` in the environment, and the server forwards it directly to the Runpod API.
|
|
46
74
|
|
|
47
75
|
### Claude Code
|
|
48
76
|
|
|
@@ -90,6 +118,8 @@ Windows:
|
|
|
90
118
|
|
|
91
119
|
Restart Claude Desktop after saving.
|
|
92
120
|
|
|
121
|
+
For remote clients such as Claude's connector, use the hosted HTTP server instead (the [Quick start](#quick-start) above). The client then runs the OAuth "Sign in with Runpod" flow, and the resulting Runpod API key is forwarded to the Runpod API on each request.
|
|
122
|
+
|
|
93
123
|
### Cursor
|
|
94
124
|
|
|
95
125
|
Add this to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` globally:
|
|
@@ -118,9 +148,42 @@ Use the same pattern:
|
|
|
118
148
|
|
|
119
149
|
For a broader list of MCP clients, see https://modelcontextprotocol.io/clients
|
|
120
150
|
|
|
151
|
+
## Usage examples
|
|
152
|
+
|
|
153
|
+
### List all Pods
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
Can you list all my Runpod Pods?
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Create a new Pod
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
Create a new Runpod Pod with the following specifications:
|
|
163
|
+
- Name: test-pod
|
|
164
|
+
- Image: runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04
|
|
165
|
+
- GPU Type: NVIDIA GeForce RTX 4090
|
|
166
|
+
- GPU Count: 1
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Create a Serverless endpoint
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
Create a Runpod Serverless endpoint with the following configuration:
|
|
173
|
+
- Name: my-endpoint
|
|
174
|
+
- Image: runpod/test-output:0.0.1
|
|
175
|
+
- GPU pool: AMPERE_80 (a "pool" value from list-gpu-types)
|
|
176
|
+
- Minimum workers: 0
|
|
177
|
+
- Maximum workers: 3
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
On the v2 API (the default) endpoints are image-based — pass an image and a GPU
|
|
181
|
+
pool, not a template. To use the legacy template-based model, pin
|
|
182
|
+
`RUNPOD_REST_VERSION=v1` and provide a `Template ID` instead.
|
|
183
|
+
|
|
121
184
|
## Hosted HTTP deployment
|
|
122
185
|
|
|
123
|
-
The package also exports a Streamable HTTP entrypoint at `@runpod/mcp-server/http`, and this repo includes a Vercel function in `api/index.ts`.
|
|
186
|
+
The package also exports a Streamable HTTP entrypoint at `@runpod/mcp-server/http`, and this repo includes a Vercel function in `api/index.ts`. This is what powers the hosted server at `https://mcp.getrunpod.io/`.
|
|
124
187
|
|
|
125
188
|
The hosted transport is stateless:
|
|
126
189
|
|
|
@@ -200,12 +263,6 @@ This validates:
|
|
|
200
263
|
- A public GraphQL-backed tool call.
|
|
201
264
|
- An authenticated REST-backed tool call.
|
|
202
265
|
|
|
203
|
-
## Claude Desktop and hosted MCP
|
|
204
|
-
|
|
205
|
-
Use the local `stdio` integration for Claude Desktop today.
|
|
206
|
-
|
|
207
|
-
For remote clients such as Claude's connector, deploy the hosted HTTP server. The client then runs the OAuth "Sign in with Runpod" flow, and the resulting Runpod API key is forwarded to the Runpod API on each request.
|
|
208
|
-
|
|
209
266
|
## Local development
|
|
210
267
|
|
|
211
268
|
```bash
|
|
@@ -240,42 +297,20 @@ RUNPOD_API_KEY=YOUR_API_KEY pnpm build
|
|
|
240
297
|
RUNPOD_API_KEY=YOUR_API_KEY pnpm smoke:stdio
|
|
241
298
|
```
|
|
242
299
|
|
|
243
|
-
## Usage examples
|
|
244
|
-
|
|
245
|
-
### List all Pods
|
|
246
|
-
|
|
247
|
-
```text
|
|
248
|
-
Can you list all my Runpod Pods?
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
### Create a new Pod
|
|
252
|
-
|
|
253
|
-
```text
|
|
254
|
-
Create a new Runpod Pod with the following specifications:
|
|
255
|
-
- Name: test-pod
|
|
256
|
-
- Image: runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04
|
|
257
|
-
- GPU Type: NVIDIA GeForce RTX 4090
|
|
258
|
-
- GPU Count: 1
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
### Create a Serverless endpoint
|
|
262
|
-
|
|
263
|
-
```text
|
|
264
|
-
Create a Runpod Serverless endpoint with the following configuration:
|
|
265
|
-
- Name: my-endpoint
|
|
266
|
-
- Template ID: 30zmvf89kd
|
|
267
|
-
- Minimum workers: 0
|
|
268
|
-
- Maximum workers: 3
|
|
269
|
-
```
|
|
270
|
-
|
|
271
300
|
## Contributing
|
|
272
301
|
|
|
273
302
|
The source is now split by responsibility:
|
|
274
303
|
|
|
275
|
-
- `src/stdio.ts`: local `stdio` entrypoint.
|
|
304
|
+
- `src/stdio.ts`: local `stdio` entrypoint (runs the v2 probe at startup for `auto` mode).
|
|
276
305
|
- `src/http.ts`: bearer-token extraction and the per-request MCP session for the Streamable HTTP transport.
|
|
277
|
-
- `src/tools.ts`:
|
|
306
|
+
- `src/tools.ts`: thin orchestrator — builds the shared runtime and calls each per-resource registrar.
|
|
307
|
+
- `src/tools/<resource>.ts`: the tools for one resource (`pods`, `endpoints`, `jobs`, `templates`, `network-volumes`, `registries`, `catalog`), each with a description + MCP annotations.
|
|
308
|
+
- `src/tools/runtime.ts`: the shared per-server runtime (caller-tracking, the authenticated REST/Serverless/GraphQL clients, the v1/v2 backend resolver) threaded into every registrar.
|
|
278
309
|
- `src/server.ts`: shared server metadata and construction.
|
|
310
|
+
- `src/_shared/backend.ts`: v1/v2 routing adapter — version resolution, per-resource paths, list-envelope unwrap, and the v2 probe.
|
|
311
|
+
- `src/_shared/http.ts`: unified authenticated JSON client + `HttpError`.
|
|
312
|
+
- `src/_shared/tracking.ts`: caller-tracking header construction.
|
|
313
|
+
- `src/_shared/mappers.ts`: v1→v2 request-body mappers.
|
|
279
314
|
- `api/index.ts`: Vercel adapter and the OAuth authorization-server routes (`/.well-known/*`, `/register`, `/authorize`, `/token`).
|
|
280
315
|
|
|
281
316
|
After changes:
|
|
@@ -283,9 +318,27 @@ After changes:
|
|
|
283
318
|
```bash
|
|
284
319
|
pnpm type-check
|
|
285
320
|
pnpm lint
|
|
321
|
+
pnpm test
|
|
286
322
|
pnpm build
|
|
287
323
|
```
|
|
288
324
|
|
|
325
|
+
`pnpm test` runs the offline unit suite (outbound-request goldens, adapter, mappers, http client) — no network or API key required.
|
|
326
|
+
|
|
327
|
+
### v2 spec parity gate
|
|
328
|
+
|
|
329
|
+
`tests/spec-parity.test.ts` walks every operation in the vendored v2 OpenAPI spec (`tests/fixtures/v2-openapi.yaml`) and fails if a v2 endpoint has no MCP tool covering it (and isn't explicitly allowlisted) — the drift gate that flags when the API grows an endpoint we don't expose yet. It also runs the reverse check (no tool is left unaccounted for). It's part of `pnpm test`, hermetic (parses the committed spec; no network, no API key).
|
|
330
|
+
|
|
331
|
+
Refresh the vendored spec when the v2 API changes:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
pnpm tsx scripts/fetch-v2-spec.ts # re-fetch tests/fixtures/v2-openapi.yaml
|
|
335
|
+
pnpm test # parity test shows any newly-uncovered endpoint
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
The serverless runtime tools (`run-endpoint`, `get-job-status`, …) target `api.runpod.ai/v2`, which is a different service from the v2 REST control plane, so they are allowlisted as intentionally spec-unmapped. The spec has no logs/artifacts endpoints, so there are no such tools.
|
|
339
|
+
|
|
340
|
+
An optional live shape check (skipped by default) verifies the live endpoints still return the envelopes the list tools unwrap; run it with `MCP_LIVE_V2_KEY=<dev-key> pnpm test` (optionally `MCP_LIVE_V2_BASE`).
|
|
341
|
+
|
|
289
342
|
For transport validation:
|
|
290
343
|
|
|
291
344
|
```bash
|
|
@@ -293,10 +346,77 @@ pnpm smoke:stdio
|
|
|
293
346
|
pnpm smoke:http
|
|
294
347
|
```
|
|
295
348
|
|
|
349
|
+
To exercise a real create→get→delete lifecycle against a **dev account** (free resources only — templates and registry auths — with fail-closed teardown):
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
RUNPOD_API_KEY=YOUR_DEV_KEY \
|
|
353
|
+
RUNPOD_REST_V2_API_URL=https://v2-rest.runpod.dev/v2 \
|
|
354
|
+
pnpm smoke:crud v1 v2
|
|
355
|
+
```
|
|
356
|
+
|
|
296
357
|
This project uses [changesets](https://github.com/changesets/changesets) for versioning and npm publishing. Every PR with user-facing changes needs a changeset file at `.changeset/DESCRIPTIVE_NAME.md`.
|
|
297
358
|
|
|
298
359
|
See `CLAUDE.md` and `docs/context.md` for contributor guidance.
|
|
299
360
|
|
|
361
|
+
## Reference
|
|
362
|
+
|
|
363
|
+
### Deployment modes
|
|
364
|
+
|
|
365
|
+
The server supports two deployment modes:
|
|
366
|
+
|
|
367
|
+
- Local `stdio` for Claude Desktop, Claude Code, Cursor, VS Code, and other MCP clients that launch a local process. The caller sets `RUNPOD_API_KEY` in the environment.
|
|
368
|
+
- Hosted Streamable HTTP for Vercel or other HTTP-capable platforms. Each request carries its own `Authorization: Bearer <token>`, which the server forwards directly to the Runpod API. The token can be a Runpod API key or one obtained through the OAuth "Sign in with Runpod" flow.
|
|
369
|
+
|
|
370
|
+
The server never holds a credential of its own and never shares one across users.
|
|
371
|
+
|
|
372
|
+
### REST API version (v1 / v2)
|
|
373
|
+
|
|
374
|
+
The server can target either the v1 REST API (`rest.runpod.io/v1`) or the newer v2 REST API (`v2-rest.runpod.io/v2`). It **defaults to v2**; set `RUNPOD_REST_VERSION=v1` to pin the previous v1 behavior. These environment variables are read once at startup:
|
|
375
|
+
|
|
376
|
+
| Variable | Values | Default | Effect |
|
|
377
|
+
| -------------------------------- | ---------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------- |
|
|
378
|
+
| `RUNPOD_REST_VERSION` | `v1` \| `v2` \| `auto` | `v2` | Version used for all resources. |
|
|
379
|
+
| `RUNPOD_REST_VERSION_<RESOURCE>` | `v1` \| `v2` \| `auto` | — | Per-resource override (e.g. `RUNPOD_REST_VERSION_PODS=v2`). Takes precedence over the global setting. |
|
|
380
|
+
| `RUNPOD_REST_V2_API_URL` | URL | `https://v2-rest.runpod.io/v2` | v2 base URL. Override to target a non-prod host. |
|
|
381
|
+
| `RUNPOD_REST_API_URL` | URL | `https://rest.runpod.io/v1` | v1 base URL. |
|
|
382
|
+
| `RUNPOD_SERVERLESS_API_URL` | URL | `https://api.runpod.ai/v2` | Serverless runtime base URL. |
|
|
383
|
+
|
|
384
|
+
Notes:
|
|
385
|
+
|
|
386
|
+
- **Default is v2** — with nothing set, every control-plane resource uses the v2 REST API. Set `RUNPOD_REST_VERSION=v1` to pin the previous v1 behavior.
|
|
387
|
+
- **Pinning a deployment** — the env var is read once at startup, so set `RUNPOD_REST_VERSION` (`v1` or `v2`) in the host's environment (e.g. a Vercel project env var) and redeploy; no code change. Hosted HTTP honors this default like any other transport.
|
|
388
|
+
- **What `auto` does:** it probes v2 once at startup and falls back to v1 — but **only on the `stdio` transport** (one process = one key). On hosted HTTP `auto` resolves to **v1**, because a warm instance serves many users and a cached probe verdict could leak across them. `auto` is a stdio-only convenience; on HTTP, rely on the default or pin the version explicitly.
|
|
389
|
+
- `jobs` (serverless runtime) always uses v1 regardless of the setting — it has no v2 REST home (it targets `api.runpod.ai/v2`, a different service).
|
|
390
|
+
- The v2-only tools (`list-cpu-types`, `get-gpu-type`, `restart-pod`) return a clear "v2 only" notice when called under v1.
|
|
391
|
+
|
|
392
|
+
> **⚠️ Migration note — `create-endpoint` / `update-endpoint` changed shape in v2.** Serverless endpoints now use the v2 API (`/v2/serverless`) with an **inline config** instead of a `templateId`. On v2, `create-endpoint` requires `imageName` + `gpuPoolIds` (GPU **pool** names from `list-gpu-types` — the `pool` field, e.g. `AMPERE_80`), plus optional `workersMin`/`workersMax`, `scalerType`/`scalerValue`/`idleTimeout`, `containerDiskInGb`, `env`, `flashboot`, etc. It no longer accepts `templateId`. **If you previously called `create-endpoint` with `{ templateId }` and have no `RUNPOD_REST_VERSION` set, that call now returns a clean `400` after upgrading** — switch to the inline fields, or pin `RUNPOD_REST_VERSION=v1` to keep the legacy template-based model.
|
|
393
|
+
|
|
394
|
+
- `create-pod` for a **CPU pod** (`computeType: "CPU"`) on v2 is transparently served by the **v1** API — v2 has no CPU pods yet — and the reply is flagged `_servedBy: "v1"`. Because that fallback hits the **v1 base**, set `RUNPOD_REST_API_URL` to match your environment when running v2 against a non-prod host (otherwise CPU creates land on v1 **prod**). On v2 a create with neither `gpuTypeIds` nor `computeType` is rejected — absence is never silently turned into a CPU pod.
|
|
395
|
+
|
|
396
|
+
Example (stdio client config) — v2 against prod:
|
|
397
|
+
|
|
398
|
+
```json
|
|
399
|
+
"env": {
|
|
400
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY",
|
|
401
|
+
"RUNPOD_REST_VERSION": "v2"
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Targeting a **non-prod (dev) environment** — point **both** bases at it (the v1 base matters even in v2 mode, for the CPU-pod fallback above):
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
"env": {
|
|
409
|
+
"RUNPOD_API_KEY": "YOUR_DEV_KEY",
|
|
410
|
+
"RUNPOD_REST_VERSION": "v2",
|
|
411
|
+
"RUNPOD_REST_V2_API_URL": "https://v2-rest.runpod.dev/v2",
|
|
412
|
+
"RUNPOD_REST_API_URL": "https://rest.runpod.dev/v1"
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Large tool output
|
|
417
|
+
|
|
418
|
+
Resource **lists** are paginated (default 20 items, `nextCursor`), so a big account can't flood the agent's context. But **serverless job output** — `run-endpoint`, `runsync-endpoint`, `get-job-status`, and especially `stream-job` (which accumulates every chunk) — is returned **as-is and is not size-capped**. It's a single opaque payload, not a list, so there's no cursor to page. A very large or long-streaming result can exceed the context window. If output may be huge, have the agent **write it to a file** instead of returning it inline, or set `s3Config` on the job so large outputs go to object storage.
|
|
419
|
+
|
|
300
420
|
## Security considerations
|
|
301
421
|
|
|
302
422
|
This server acts with the full permissions of the supplied `RUNPOD_API_KEY`.
|