@runpod/mcp-server 1.0.0 → 1.2.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 +15 -0
- package/README.md +167 -61
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +512 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +502 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -18
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @runpod/mcp-server
|
|
2
|
+
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7b715eb: Add list-gpu-types and list-data-centers tools using public GraphQL API for hardware and region discovery. Enhance list-templates with filter params (includeRunpodTemplates, includePublicTemplates, includeEndpointBoundTemplates). Add tool descriptions to create-pod and list-templates recommending Pytorch 2.8.0 as default template.
|
|
8
|
+
- ea2451b: Add Serverless endpoint runtime tools for invoking deployed workers. New tools: run-endpoint (async), runsync-endpoint (sync), get-job-status, stream-job, cancel-job, retry-job, endpoint-health, and purge-endpoint-queue. These use the Serverless API at api.runpod.ai/v2 with a new serverlessRequest helper.
|
|
9
|
+
- 34c0463: Add caller tracking headers to every outbound API call. Each request now carries a structured `User-Agent` (`runpod-mcp-server/<version> (caller=mcp; client=<mcp_client_name>; client_version=<mcp_client_version>; transport=<stdio|http>)`) and an anonymous per-process `X-Runpod-Session-Id` UUID. The MCP client identity is sourced from the `initialize` handshake's `clientInfo`. No tool behavior changes — observability only — so the Runpod platform can attribute traffic to specific MCP clients (Claude Code, Cursor, Codex, Gemini CLI, etc.) and count distinct agent sessions.
|
|
10
|
+
|
|
11
|
+
## 1.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- c49b2cc: Add npx support for running the MCP server directly without installation. Includes bin field in package.json, shebang in build output, and updated README with npx command. Also fixes branding consistency (RunPod -> Runpod) and adds development conventions documentation.
|
package/README.md
CHANGED
|
@@ -1,133 +1,239 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Runpod MCP server
|
|
2
2
|
[](https://smithery.ai/server/@runpod/runpod-mcp-ts)
|
|
3
3
|
|
|
4
|
-
This Model Context Protocol (MCP) server
|
|
4
|
+
This Model Context Protocol (MCP) server lets you manage Runpod infrastructure through any MCP-compatible client. It provides tools for working with Pods, Serverless endpoints, templates, network volumes, and container registry authentications.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Quick start
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Requirements
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- **Templates**: Create, list, get details, update, and delete templates
|
|
13
|
-
- **Network Volumes**: Create, list, get details, update, and delete network volumes
|
|
14
|
-
- **Container Registry Authentications**: Create, list, get details, and delete authentications
|
|
10
|
+
- Node.js 18 or higher.
|
|
11
|
+
- A Runpod account and API key ([get your API key](https://www.runpod.io/console/user/settings)).
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
### Running with npx
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
You can run the server directly without installation:
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
```bash
|
|
18
|
+
RUNPOD_API_KEY=YOUR_API_KEY npx @runpod/mcp-server@latest
|
|
19
|
+
```
|
|
23
20
|
|
|
24
21
|
### Installing via Smithery
|
|
25
22
|
|
|
26
|
-
To install
|
|
23
|
+
To install for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@runpod/runpod-mcp-ts):
|
|
27
24
|
|
|
28
25
|
```bash
|
|
29
26
|
npx -y @smithery/cli install @runpod/runpod-mcp-ts --client claude
|
|
30
27
|
```
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
## Setting up with your client
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
2. Install dependencies:
|
|
36
|
-
```
|
|
37
|
-
pnpm install
|
|
38
|
-
```
|
|
39
|
-
3. Build the server:
|
|
40
|
-
```
|
|
41
|
-
pnpm build
|
|
42
|
-
```
|
|
31
|
+
Most MCP clients use a JSON configuration file with the same general structure. The examples below show the npx approach (recommended for most users) and the local build approach (for development). Replace `YOUR_API_KEY` with your actual Runpod API key.
|
|
43
32
|
|
|
44
|
-
###
|
|
33
|
+
### Claude Code
|
|
45
34
|
|
|
46
|
-
|
|
35
|
+
Add the MCP server globally so it's available across all your projects:
|
|
47
36
|
|
|
48
37
|
```bash
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
claude mcp add runpod -s user \
|
|
39
|
+
-e RUNPOD_API_KEY=YOUR_API_KEY \
|
|
40
|
+
-- npx -y @runpod/mcp-server@latest
|
|
41
|
+
```
|
|
51
42
|
|
|
52
|
-
|
|
53
|
-
set RUNPOD_API_KEY=your_api_key_here
|
|
43
|
+
Or add it to a specific project (creates a `.mcp.json` file you can commit):
|
|
54
44
|
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
```bash
|
|
46
|
+
claude mcp add runpod -s project \
|
|
47
|
+
-e RUNPOD_API_KEY=YOUR_API_KEY \
|
|
48
|
+
-- npx -y @runpod/mcp-server@latest
|
|
57
49
|
```
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
Verify the server is connected with `claude mcp list`. If you're in an active session, type `/mcp` to reconnect without restarting.
|
|
60
52
|
|
|
61
|
-
###
|
|
53
|
+
### Claude Desktop
|
|
62
54
|
|
|
63
|
-
|
|
55
|
+
Edit the config file at `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
64
56
|
|
|
65
|
-
```
|
|
66
|
-
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"runpod": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["-y", "@runpod/mcp-server@latest"],
|
|
63
|
+
"env": {
|
|
64
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Restart Claude Desktop after saving.
|
|
72
|
+
|
|
73
|
+
### Cursor
|
|
74
|
+
|
|
75
|
+
Add the following to `.cursor/mcp.json` in your project directory, or `~/.cursor/mcp.json` for global access:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"runpod": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "@runpod/mcp-server@latest"],
|
|
83
|
+
"env": {
|
|
84
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Windsurf
|
|
92
|
+
|
|
93
|
+
Open Windsurf settings (Cmd+Shift+P → "Open Windsurf Settings"), navigate to the Cascade section, and enable MCP. Then edit `~/.codeium/windsurf/mcp_config.json`:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"runpod": {
|
|
99
|
+
"command": "npx",
|
|
100
|
+
"args": ["-y", "@runpod/mcp-server@latest"],
|
|
101
|
+
"env": {
|
|
102
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### VS Code (GitHub Copilot)
|
|
110
|
+
|
|
111
|
+
MCP works in VS Code's agent mode (requires VS Code 1.101+). Add the following to `.vscode/mcp.json` in your workspace:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"runpod": {
|
|
117
|
+
"command": "npx",
|
|
118
|
+
"args": ["-y", "@runpod/mcp-server@latest"],
|
|
119
|
+
"env": {
|
|
120
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
67
125
|
```
|
|
68
126
|
|
|
69
|
-
|
|
127
|
+
Click the "Start" button next to the server entry to connect.
|
|
128
|
+
|
|
129
|
+
### Cline
|
|
70
130
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
131
|
+
Open Cline in VS Code, click the hamburger menu (☰), and go to MCP Servers. You can add servers through the marketplace or manually configure in Cline's settings using the same JSON structure shown above.
|
|
132
|
+
|
|
133
|
+
### JetBrains IDEs
|
|
134
|
+
|
|
135
|
+
Create a `mcp.json` file at `~/.junie/mcp.json` (global) or `.junie/mcp/` in your project:
|
|
74
136
|
|
|
75
137
|
```json
|
|
76
138
|
{
|
|
77
139
|
"mcpServers": {
|
|
78
140
|
"runpod": {
|
|
79
|
-
"command": "
|
|
80
|
-
"args": ["/
|
|
141
|
+
"command": "npx",
|
|
142
|
+
"args": ["-y", "@runpod/mcp-server@latest"],
|
|
81
143
|
"env": {
|
|
82
|
-
"RUNPOD_API_KEY": "
|
|
144
|
+
"RUNPOD_API_KEY": "YOUR_API_KEY"
|
|
83
145
|
}
|
|
84
146
|
}
|
|
85
147
|
}
|
|
86
148
|
}
|
|
87
149
|
```
|
|
88
150
|
|
|
89
|
-
|
|
151
|
+
### Other clients
|
|
152
|
+
|
|
153
|
+
This server uses stdio transport and works with any MCP-compatible client. The configuration pattern is the same across all clients — point the command to `npx` with `@runpod/mcp-server@latest` as the argument, and set `RUNPOD_API_KEY` in the environment. For a full list of MCP clients, see the [official MCP clients page](https://modelcontextprotocol.io/clients).
|
|
154
|
+
|
|
155
|
+
## Using a local build
|
|
156
|
+
|
|
157
|
+
If you want to run from a local clone of the repo (for development or to test unreleased changes):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
git clone https://github.com/runpod/runpod-mcp.git
|
|
161
|
+
cd runpod-mcp
|
|
162
|
+
pnpm install
|
|
163
|
+
pnpm build
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Then replace the `command` and `args` in any of the configurations above with:
|
|
90
167
|
|
|
91
|
-
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"command": "node",
|
|
171
|
+
"args": ["/absolute/path/to/runpod-mcp/dist/index.mjs"]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
92
174
|
|
|
93
|
-
|
|
175
|
+
After making changes to the source, re-run `pnpm build` and restart or reconnect the MCP server for changes to take effect.
|
|
94
176
|
|
|
95
|
-
|
|
177
|
+
## Usage examples
|
|
96
178
|
|
|
97
|
-
### List all
|
|
179
|
+
### List all Pods
|
|
98
180
|
|
|
99
181
|
```
|
|
100
|
-
Can you list all my
|
|
182
|
+
Can you list all my Runpod Pods?
|
|
101
183
|
```
|
|
102
184
|
|
|
103
|
-
### Create a new
|
|
185
|
+
### Create a new Pod
|
|
104
186
|
|
|
105
187
|
```
|
|
106
|
-
Create a new
|
|
188
|
+
Create a new Runpod Pod with the following specifications:
|
|
107
189
|
- Name: test-pod
|
|
108
190
|
- Image: runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04
|
|
109
191
|
- GPU Type: NVIDIA GeForce RTX 4090
|
|
110
192
|
- GPU Count: 1
|
|
111
193
|
```
|
|
112
194
|
|
|
113
|
-
### Create a
|
|
195
|
+
### Create a Serverless endpoint
|
|
114
196
|
|
|
115
197
|
```
|
|
116
|
-
Create a
|
|
198
|
+
Create a Runpod Serverless endpoint with the following configuration:
|
|
117
199
|
- Name: my-endpoint
|
|
118
200
|
- Template ID: 30zmvf89kd
|
|
119
201
|
- Minimum workers: 0
|
|
120
202
|
- Maximum workers: 3
|
|
121
203
|
```
|
|
122
204
|
|
|
123
|
-
##
|
|
205
|
+
## Contributing
|
|
206
|
+
|
|
207
|
+
To get started with local development, clone the repo and build:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
git clone https://github.com/runpod/runpod-mcp.git
|
|
211
|
+
cd runpod-mcp
|
|
212
|
+
pnpm install
|
|
213
|
+
pnpm build
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
After making changes, rebuild with `pnpm build`. In Claude Code, type `/mcp` to reconnect to the updated server without restarting your session. You can also use `pnpm build:watch` for auto-rebuilding during development.
|
|
217
|
+
|
|
218
|
+
All tools live in `src/index.ts`. The server uses two backends: the REST API (`runpodRequest()`) for authenticated CRUD operations, and the GraphQL API (`graphqlRequest()`) for public read-only queries like GPU types and data centers. Follow existing patterns when adding new tools — kebab-case names, Zod schemas with `.describe()`, and JSON stringified responses.
|
|
219
|
+
|
|
220
|
+
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`:
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
---
|
|
224
|
+
"@runpod/mcp-server": minor
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
Description of what changed and why.
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Use `patch` for bug fixes, `minor` for new tools or features, and `major` for breaking changes. The `.changeset/` directory is gitignored, so use `git add -f` to stage changeset files.
|
|
231
|
+
|
|
232
|
+
See [CLAUDE.md](./CLAUDE.md) for the full development guide including architecture details, tool conventions, and known issues.
|
|
124
233
|
|
|
125
|
-
|
|
234
|
+
## Security considerations
|
|
126
235
|
|
|
127
|
-
|
|
128
|
-
- Be cautious about what operations you perform
|
|
129
|
-
- Consider setting up a separate API key with limited permissions
|
|
130
|
-
- Don't use this in a production environment without proper security measures
|
|
236
|
+
This server requires your Runpod API key, which grants full access to your Runpod account. Never share your API key. Be cautious about what operations you perform, and consider setting up a separate API key with limited permissions. Do not use this in a production environment without proper security measures.
|
|
131
237
|
|
|
132
238
|
## License
|
|
133
239
|
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED