code-engine-mcp-server 1.0.2 → 1.0.3
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/LICENSE +1 -1
- package/README.md +368 -31
- package/build/index.js +864 -4
- package/build/index.js.map +1 -1
- package/docs/SETUP_INSTRUCTIONS.md +2 -0
- package/package.json +13 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -14,11 +14,12 @@ It enables AI assistants to build, run, push, and deploy containerized workloads
|
|
|
14
14
|
|
|
15
15
|
- [What You Get](#what-you-get)
|
|
16
16
|
- [Quick Start](#quick-start)
|
|
17
|
+
- [Deploy Your First App](#deploy-your-first-app)
|
|
17
18
|
- [Documentation](#documentation)
|
|
18
19
|
- [Project Structure](#project-structure)
|
|
19
20
|
- [Features](#features)
|
|
20
21
|
- [Configuration](#configuration)
|
|
21
|
-
- [
|
|
22
|
+
- [npm and MCP Registry](#npm-and-mcp-registry)
|
|
22
23
|
- [Example Prompts](#example-prompts)
|
|
23
24
|
- [Available Tools](#available-tools)
|
|
24
25
|
- [Environment Variables](#environment-variables)
|
|
@@ -34,8 +35,9 @@ It enables AI assistants to build, run, push, and deploy containerized workloads
|
|
|
34
35
|
## ✨ What You Get
|
|
35
36
|
|
|
36
37
|
- Container workflow tools for Docker or Podman
|
|
38
|
+
- IBM Container Registry (ICR) tools — list namespaces, list images, delete images
|
|
37
39
|
- IBM Code Engine project and application management tools
|
|
38
|
-
- MCP-ready setup for GitHub Copilot, Cline, and
|
|
40
|
+
- MCP-ready setup for GitHub Copilot, Cline, Claude Desktop, and the optional VS Code extension in `vscode-extension/`
|
|
39
41
|
- A simple local development and troubleshooting workflow
|
|
40
42
|
|
|
41
43
|
## 🚀 Quick Start
|
|
@@ -53,13 +55,260 @@ node build/index.js
|
|
|
53
55
|
|
|
54
56
|
Then configure your MCP client using one of the examples in the Configuration section below.
|
|
55
57
|
|
|
56
|
-
##
|
|
58
|
+
## � Deploy Your First App
|
|
59
|
+
|
|
60
|
+
This walks through deploying the included [Star Wars splash page example](./examples/starwars-splash/) — a static nginx container — entirely through the MCP server.
|
|
61
|
+
|
|
62
|
+
> **Apple Silicon users:** always build with `--platform linux/amd64`. Code Engine runs amd64 only.
|
|
63
|
+
|
|
64
|
+
### Step 1 — Build and push the image
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd examples/starwars-splash
|
|
68
|
+
podman build --platform linux/amd64 -t us.icr.io/<your-namespace>/starwars-splash:v1.0.0 .
|
|
69
|
+
podman push us.icr.io/<your-namespace>/starwars-splash:v1.0.0
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or ask your assistant:
|
|
73
|
+
```
|
|
74
|
+
Build examples/starwars-splash as us.icr.io/my-namespace/starwars-splash:v1.0.0 for linux/amd64 and push it
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**MCP response — `build_container_image`:**
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"success": true,
|
|
81
|
+
"command": "podman build --platform linux/amd64 -t us.icr.io/my-namespace/starwars-splash:v1.0.0 ...",
|
|
82
|
+
"build_output": "STEP 1/5: FROM nginx:alpine\nSTEP 2/5: COPY index.html /usr/share/nginx/html/index.html\nSTEP 3/5: RUN sed -i 's/listen 80;/listen 8080;/g' /etc/nginx/conf.d/default.conf\nSTEP 4/5: EXPOSE 8080\nSTEP 5/5: CMD [\"nginx\", \"-g\", \"daemon off;\"]\nSuccessfully tagged us.icr.io/my-namespace/starwars-splash:v1.0.0"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> **Note:** Container runtimes (Podman/Docker) write build progress to stderr. The `build_output` field combines stdout and stderr so you see the full build log.
|
|
87
|
+
|
|
88
|
+
**MCP response — `push_container_image`:**
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"success": true,
|
|
92
|
+
"command": "podman push us.icr.io/my-namespace/starwars-splash:v1.0.0",
|
|
93
|
+
"output": "Getting image source signatures\nCopying blobs...\nWriting manifest to image destination"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 2 — Create a registry pull secret
|
|
98
|
+
|
|
99
|
+
Ask your assistant (once per project):
|
|
100
|
+
```
|
|
101
|
+
Create a registry secret called icr-pull-secret in project <project-id> for us.icr.io using my IBM Cloud API key
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Or use the `ce_create_secret` tool directly:
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"project_id": "<your-project-id>",
|
|
108
|
+
"name": "icr-pull-secret",
|
|
109
|
+
"format": "registry",
|
|
110
|
+
"data": {
|
|
111
|
+
"username": "iamapikey",
|
|
112
|
+
"password": "<your-ibm-cloud-api-key>",
|
|
113
|
+
"server": "us.icr.io",
|
|
114
|
+
"email": "user@example.com"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**MCP response — `ce_create_secret`:**
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"name": "icr-pull-secret",
|
|
123
|
+
"format": "registry",
|
|
124
|
+
"resource_type": "secret_registry_v2",
|
|
125
|
+
"created_at": "2026-05-08T22:10:00Z",
|
|
126
|
+
"project_id": "<your-project-id>"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Step 3 — Deploy the application
|
|
131
|
+
|
|
132
|
+
Ask your assistant:
|
|
133
|
+
```
|
|
134
|
+
Deploy us.icr.io/my-namespace/starwars-splash:v1.0.0 to Code Engine project <project-id>
|
|
135
|
+
as app "starwars-splash" using pull secret icr-pull-secret, min 1 instance
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Or use the `ce_create_application` tool:
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"project_id": "<your-project-id>",
|
|
142
|
+
"name": "starwars-splash",
|
|
143
|
+
"image": "us.icr.io/<your-namespace>/starwars-splash:v1.0.0",
|
|
144
|
+
"image_secret": "icr-pull-secret",
|
|
145
|
+
"scale_min_instances": 1,
|
|
146
|
+
"scale_max_instances": 3
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**MCP response — `ce_create_application`:**
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"name": "starwars-splash",
|
|
154
|
+
"resource_type": "app_v2",
|
|
155
|
+
"status": "deploying",
|
|
156
|
+
"image_reference": "us.icr.io/my-namespace/starwars-splash:v1.0.0",
|
|
157
|
+
"image_secret": "icr-pull-secret",
|
|
158
|
+
"image_port": 8080,
|
|
159
|
+
"scale_min_instances": 1,
|
|
160
|
+
"scale_max_instances": 3,
|
|
161
|
+
"scale_cpu_limit": "1",
|
|
162
|
+
"scale_memory_limit": "4G",
|
|
163
|
+
"endpoint": "https://starwars-splash.<subdomain>.us-south.codeengine.appdomain.cloud",
|
|
164
|
+
"status_details": {
|
|
165
|
+
"latest_created_revision": "starwars-splash-00001",
|
|
166
|
+
"latest_ready_revision": null
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Step 4 — Check deployment status
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
Get details for the starwars-splash app in project <project-id>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This calls `ce_get_application` and returns the public URL once the app reaches `ready` status.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
List the running instances of starwars-splash in project <project-id>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This calls `ce_list_app_instances` (or `ce_get_app_instance` for a specific instance) and shows:
|
|
184
|
+
- Instance name and revision
|
|
185
|
+
- Container status (`running` / `pending` / `failed`)
|
|
186
|
+
- Restart count
|
|
187
|
+
- Started-at timestamp
|
|
188
|
+
- CPU and memory allocation
|
|
189
|
+
|
|
190
|
+
**MCP response — `ce_get_application` (once ready):**
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"name": "starwars-splash",
|
|
194
|
+
"status": "ready",
|
|
195
|
+
"image_reference": "us.icr.io/my-namespace/starwars-splash:v1.0.0",
|
|
196
|
+
"image_port": 8080,
|
|
197
|
+
"scale_min_instances": 1,
|
|
198
|
+
"scale_max_instances": 3,
|
|
199
|
+
"scale_cpu_limit": "0.5",
|
|
200
|
+
"scale_memory_limit": "1G",
|
|
201
|
+
"region": "us-south",
|
|
202
|
+
"endpoint": "https://starwars-splash.<subdomain>.us-south.codeengine.appdomain.cloud",
|
|
203
|
+
"status_details": {
|
|
204
|
+
"latest_created_revision": "starwars-splash-00001",
|
|
205
|
+
"latest_ready_revision": "starwars-splash-00001"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Step 5 — Map a custom domain (optional)
|
|
211
|
+
|
|
212
|
+
To serve the app at your own domain (e.g. `myapp.example.com`) you need a TLS certificate. The IBM Code Engine REST API always requires a real certificate — IBM's Console "Platform managed" option is not available via the API.
|
|
213
|
+
|
|
214
|
+
**5a — Get a Let's Encrypt certificate (certbot)**
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Install once
|
|
218
|
+
brew install certbot
|
|
219
|
+
|
|
220
|
+
# Request cert — certbot will print a DNS TXT challenge value
|
|
221
|
+
mkdir -p ~/certbot/{config,work,logs}
|
|
222
|
+
/opt/homebrew/bin/certbot certonly --manual --preferred-challenges dns \
|
|
223
|
+
-d <your-domain> --agree-tos --no-eff-email --email you@example.com \
|
|
224
|
+
--config-dir ~/certbot/config --work-dir ~/certbot/work --logs-dir ~/certbot/logs
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Certbot will pause and ask you to add a TXT record:
|
|
228
|
+
```
|
|
229
|
+
Add TXT record: _acme-challenge.<your-domain> = <challenge-value>
|
|
230
|
+
```
|
|
231
|
+
Verify propagation, then press Enter. Certbot writes:
|
|
232
|
+
- `~/certbot/config/live/<your-domain>/fullchain.pem`
|
|
233
|
+
- `~/certbot/config/live/<your-domain>/privkey.pem`
|
|
234
|
+
|
|
235
|
+
**5b — Create the TLS secret in Code Engine**
|
|
236
|
+
|
|
237
|
+
Ask your assistant:
|
|
238
|
+
```
|
|
239
|
+
Create a TLS secret called starwars-tls in project <project-id>
|
|
240
|
+
using cert ~/certbot/config/live/myapp.example.com/fullchain.pem
|
|
241
|
+
and key ~/certbot/config/live/myapp.example.com/privkey.pem
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
This calls `ce_create_tls_secret_from_pem` — reads the PEM files from disk and stores them as a Code Engine `tls` secret.
|
|
245
|
+
|
|
246
|
+
**MCP response — `ce_create_tls_secret_from_pem`:**
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"name": "my-tls",
|
|
250
|
+
"format": "tls",
|
|
251
|
+
"resource_type": "secret_tls_v2",
|
|
252
|
+
"created_at": "2026-05-08T22:30:00Z",
|
|
253
|
+
"project_id": "<your-project-id>"
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**5c — Create the domain mapping**
|
|
258
|
+
|
|
259
|
+
Ask your assistant:
|
|
260
|
+
```
|
|
261
|
+
Map domain myapp.example.com to app my-app
|
|
262
|
+
in project <project-id> using TLS secret my-tls
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
This calls `ce_create_domain_mapping` and returns the `cname_target`.
|
|
266
|
+
|
|
267
|
+
**MCP response — `ce_create_domain_mapping`:**
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"name": "myapp.example.com",
|
|
271
|
+
"status": "ready",
|
|
272
|
+
"cname_target": "custom.<subdomain>.us-south.codeengine.appdomain.cloud",
|
|
273
|
+
"component": {
|
|
274
|
+
"resource_type": "app_v2",
|
|
275
|
+
"name": "my-app"
|
|
276
|
+
},
|
|
277
|
+
"tls_secret": "my-tls",
|
|
278
|
+
"region": "us-south"
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**5d — Update your CNAME**
|
|
283
|
+
|
|
284
|
+
In your DNS provider, set:
|
|
285
|
+
```
|
|
286
|
+
myapp.example.com CNAME custom.<subdomain>.us-south.codeengine.appdomain.cloud
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Use the `cname_target` value returned in 5c (it uses the `custom.` prefix, not the app name).
|
|
290
|
+
|
|
291
|
+
Once DNS propagates, `https://<your-domain>` serves the app with a valid TLS certificate.
|
|
292
|
+
|
|
293
|
+
> **Certificate renewal:** Let's Encrypt certs expire after 90 days. Re-run certbot to get updated PEM files, then ask Copilot to run `ce_renew_tls_secret_from_pem` — it patches the existing secret in-place so your domain mapping continues working without any changes.
|
|
294
|
+
|
|
295
|
+
### Full one-shot prompt
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
I have a Star Wars splash page in examples/starwars-splash.
|
|
299
|
+
Build it for linux/amd64 as us.icr.io/my-namespace/starwars-splash:v1.0.0,
|
|
300
|
+
push it, then deploy it to Code Engine project <project-id> with pull secret icr-pull-secret.
|
|
301
|
+
Tell me the public URL and confirm the instance is running.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## �📖 Documentation
|
|
57
305
|
|
|
58
306
|
- [Code Engine API Reference](./docs/CODE_ENGINE_API_REFERENCE.md)
|
|
59
307
|
- [API Call Scenarios](./docs/API_CALL_SCENARIOS.md)
|
|
60
308
|
- [Setup Instructions](./docs/SETUP_INSTRUCTIONS.md)
|
|
61
309
|
- [Client README](./docs/CLIENT_README.md)
|
|
62
310
|
- [Cline MCP Config Example](./docs/CLINE_CONFIG_EXAMPLE.json)
|
|
311
|
+
- [VS Code MCP extension](./vscode-extension/README.md) (registers this server via settings; no `mcp.json` required for the default `npx` flow)
|
|
63
312
|
- [Code of Conduct](./docs/CODE_OF_CONDUCT.md)
|
|
64
313
|
- [Contributing Guide](./docs/CONTRIBUTING.md)
|
|
65
314
|
- [Maintainers](./docs/MAINTAINERS.md)
|
|
@@ -81,6 +330,7 @@ code-engine-mcp-server/
|
|
|
81
330
|
├── MAINTAINERS.md # Maintainer list
|
|
82
331
|
├── README.md # Project overview and usage
|
|
83
332
|
├── mcp.example.json # Example MCP client configuration
|
|
333
|
+
├── vscode-extension/ # Optional VS Code extension (MCP definition provider)
|
|
84
334
|
├── package.json # npm package metadata and scripts
|
|
85
335
|
├── server.json # MCP Registry metadata
|
|
86
336
|
└── tsconfig.json # TypeScript configuration
|
|
@@ -90,23 +340,61 @@ code-engine-mcp-server/
|
|
|
90
340
|
|
|
91
341
|
### Container Runtime Tools (Docker/Podman)
|
|
92
342
|
- ✅ Detect container runtime (Docker/Podman)
|
|
93
|
-
- ✅ Build container images
|
|
343
|
+
- ✅ Build container images (with platform targeting for amd64)
|
|
94
344
|
- ✅ Push images to registries
|
|
95
345
|
- ✅ List local images
|
|
96
346
|
- ✅ Test containers locally
|
|
97
347
|
- ✅ Get container logs
|
|
98
348
|
- ✅ Stop and remove containers
|
|
99
349
|
- ✅ List all containers
|
|
350
|
+
- ✅ Validate Dockerfile for Code Engine compatibility (`ce_validate_dockerfile`) — checks architecture, port, nginx sed patterns, USER, CMD
|
|
351
|
+
|
|
352
|
+
### IBM Container Registry (ICR)
|
|
353
|
+
- ✅ List ICR namespaces
|
|
354
|
+
- ✅ List images with optional namespace filter
|
|
355
|
+
- ✅ Delete images by tag
|
|
100
356
|
|
|
101
357
|
### IBM Code Engine Tools
|
|
102
|
-
- ✅ List
|
|
103
|
-
- ✅
|
|
104
|
-
- ✅
|
|
105
|
-
- ✅
|
|
358
|
+
- ✅ List, create, and delete projects
|
|
359
|
+
- ✅ Deploy applications with image pull secrets
|
|
360
|
+
- ✅ Update applications (image, scaling, env)
|
|
361
|
+
- ✅ List applications and get public URLs
|
|
362
|
+
- ✅ Get per-instance status (running, restarts, started-at)
|
|
363
|
+
- ✅ Get application logs per instance
|
|
364
|
+
- ✅ Build and job management
|
|
365
|
+
- ✅ Secrets and ConfigMaps
|
|
366
|
+
- ✅ Custom domain mappings (create, list, get, delete)
|
|
367
|
+
- ✅ TLS secrets from Let's Encrypt / certbot PEM files (`ce_create_tls_secret_from_pem`)
|
|
368
|
+
- ✅ TLS cert renewal in-place without disrupting domain mappings (`ce_renew_tls_secret_from_pem`)
|
|
369
|
+
- ✅ Update any secret in-place (`ce_update_secret`)
|
|
370
|
+
- ✅ Wait for app deployment or build run to complete (`ce_wait_for_app_ready`, `ce_wait_for_build_run`)
|
|
371
|
+
- ✅ IAM token info and diagnostics (`iam_get_token_info`)
|
|
372
|
+
- ✅ Create ICR namespaces via REST API (`icr_create_namespace`)
|
|
373
|
+
|
|
374
|
+
### Procedures
|
|
375
|
+
- ✅ `proc_build_push_deploy` — full container pipeline in one prompt (build → push → deploy → wait)
|
|
376
|
+
- ✅ `proc_setup_custom_domain` — TLS cert + domain mapping in one step, returns CNAME target
|
|
377
|
+
- ✅ `proc_build_run_and_deploy` — CE source build → wait → deploy app → wait → return URL
|
|
106
378
|
|
|
107
379
|
## ⚙️ Configuration
|
|
108
380
|
|
|
109
|
-
###
|
|
381
|
+
### VS Code — IBM Code Engine MCP extension (optional)
|
|
382
|
+
|
|
383
|
+
The extension in `vscode-extension/` registers this MCP server with VS Code using the **MCP server definition provider** API (VS Code **1.101+**). You do **not** need a workspace `.vscode/mcp.json` entry for the default flow: the server is started with `npx -y code-engine-mcp-server` and your API key from settings.
|
|
384
|
+
|
|
385
|
+
1. Install the extension (from a `.vsix` built with `npm run package` inside `vscode-extension/`, or from the Marketplace when published).
|
|
386
|
+
2. Ensure **Node.js** is installed and `npx` is on your `PATH`.
|
|
387
|
+
3. Open **Settings** and search for **IBM Code Engine MCP**, or edit `settings.json` directly:
|
|
388
|
+
- `codeEngineMcp.apiKey` — your IBM Cloud API key (**required**; until this is set, the extension contributes no MCP server).
|
|
389
|
+
- `codeEngineMcp.region` — IBM Cloud region (optional, default `us-south`). Passed as `IBMCLOUD_REGION` to the server.
|
|
390
|
+
|
|
391
|
+
The extension sets `IBMCLOUD_API_KEY` and `IBMCLOUD_REGION` for the spawned process. Use GitHub Copilot and MCP in VS Code as described in the [Copilot documentation](https://code.visualstudio.com/docs/copilot/copilot-chat).
|
|
392
|
+
|
|
393
|
+
More detail: [vscode-extension/README.md](./vscode-extension/README.md).
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### 1) GitHub Copilot (VS Code) — `mcp.json` (workspace)
|
|
110
398
|
|
|
111
399
|
Copy `mcp.example.json` to `.vscode/mcp.json` in your workspace root:
|
|
112
400
|
|
|
@@ -180,13 +468,9 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
180
468
|
}
|
|
181
469
|
```
|
|
182
470
|
|
|
183
|
-
##
|
|
184
|
-
|
|
185
|
-
Install this MCP server in Cursor with one click:
|
|
471
|
+
## npm and MCP Registry
|
|
186
472
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Package and registry links:
|
|
473
|
+
Use the published package from npm or browse the MCP Registry listing:
|
|
190
474
|
|
|
191
475
|
- [npm package: code-engine-mcp-server](https://www.npmjs.com/package/code-engine-mcp-server)
|
|
192
476
|
- [MCP Registry entry: io.github.markusvankempen/code-engine-mcp-server](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.markusvankempen%2Fcode-engine-mcp-server)
|
|
@@ -240,9 +524,22 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
240
524
|
5. Show me the application URL
|
|
241
525
|
```
|
|
242
526
|
|
|
527
|
+
### Custom Domain
|
|
528
|
+
|
|
529
|
+
Ask your assistant:
|
|
530
|
+
```
|
|
531
|
+
Create a TLS secret called my-tls in project <project-id>
|
|
532
|
+
using cert ~/certbot/config/live/example.com/fullchain.pem
|
|
533
|
+
and key ~/certbot/config/live/example.com/privkey.pem.
|
|
534
|
+
Then map domain example.com to app my-app using that secret.
|
|
535
|
+
Tell me what CNAME value to set in DNS.
|
|
536
|
+
```
|
|
537
|
+
|
|
243
538
|
## 🛠️ Available Tools
|
|
244
539
|
|
|
245
|
-
|
|
540
|
+
62 tools total: 9 container tools + 4 ICR tools + 45 Code Engine tools + 1 IAM tool + 3 procedures.
|
|
541
|
+
|
|
542
|
+
> **Procedures** bundle multiple tools into a single call. Use them for common end-to-end workflows.
|
|
246
543
|
|
|
247
544
|
### Container Tools (8)
|
|
248
545
|
|
|
@@ -256,6 +553,16 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
256
553
|
| `test_container_locally` | Run container for local testing | `image_name`, `port_mapping`, `env_vars` |
|
|
257
554
|
| `get_container_logs` | Get logs from a running container | `container_id`, `runtime` |
|
|
258
555
|
| `stop_local_container` | Stop and remove a container | `container_id`, `runtime` |
|
|
556
|
+
| `ce_validate_dockerfile` | Validate a Dockerfile for Code Engine compatibility (architecture, port, nginx sed patterns, USER, CMD) | `dockerfile_path`, `context_path`, `expected_port` |
|
|
557
|
+
|
|
558
|
+
### IBM Container Registry Tools (4)
|
|
559
|
+
|
|
560
|
+
| Tool | Description | Key Parameters |
|
|
561
|
+
|------|-------------|----------------|
|
|
562
|
+
| `icr_list_namespaces` | List ICR namespaces in your account | `region` |
|
|
563
|
+
| `icr_list_images` | List images in ICR (optionally filtered by namespace) | `namespace`, `region` |
|
|
564
|
+
| `icr_delete_image` | Delete an image by full tag | `image`, `region` |
|
|
565
|
+
| `icr_create_namespace` | Create a new ICR namespace | `namespace`, `region` |
|
|
259
566
|
|
|
260
567
|
### Code Engine: Projects (4)
|
|
261
568
|
|
|
@@ -266,19 +573,21 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
266
573
|
| `ce_create_project` | Create a new project | `name`, `resource_group_id` |
|
|
267
574
|
| `ce_delete_project` | Delete a project | `project_id` |
|
|
268
575
|
|
|
269
|
-
### Code Engine: Applications (
|
|
576
|
+
### Code Engine: Applications (9)
|
|
270
577
|
|
|
271
578
|
| Tool | Description | Key Parameters |
|
|
272
579
|
|------|-------------|----------------|
|
|
273
580
|
| `ce_list_applications` | List applications in a project | `project_id` |
|
|
274
|
-
| `ce_get_application` | Get application details | `project_id`, `app_name` |
|
|
275
|
-
| `ce_create_application` | Deploy a new application | `project_id`, `name`, `image`, `port`, `env_vars` |
|
|
276
|
-
| `ce_update_application` | Update image, scaling, env | `project_id`, `app_name`, `image`, `scale_*` |
|
|
581
|
+
| `ce_get_application` | Get application details and public URL | `project_id`, `app_name` |
|
|
582
|
+
| `ce_create_application` | Deploy a new application | `project_id`, `name`, `image`, `image_secret`, `port`, `env_vars` |
|
|
583
|
+
| `ce_update_application` | Update image, scaling, env, pull secret | `project_id`, `app_name`, `image`, `image_secret`, `scale_*` |
|
|
277
584
|
| `ce_delete_application` | Delete an application | `project_id`, `app_name` |
|
|
278
|
-
| `ce_list_app_instances` | List running instances
|
|
585
|
+
| `ce_list_app_instances` | List all running instances with status | `project_id`, `app_name` |
|
|
586
|
+
| `ce_get_app_instance` | Get status details for a specific instance | `project_id`, `app_name`, `instance_name` |
|
|
279
587
|
| `ce_get_app_logs` | Get logs for an app instance | `project_id`, `app_name`, `instance_name` |
|
|
588
|
+
| `ce_wait_for_app_ready` | Poll until app status is ready or timeout; returns `poll_history` | `project_id`, `app_name`, `timeout_seconds` |
|
|
280
589
|
|
|
281
|
-
### Code Engine: Builds (
|
|
590
|
+
### Code Engine: Builds (9)
|
|
282
591
|
|
|
283
592
|
| Tool | Description | Key Parameters |
|
|
284
593
|
|------|-------------|----------------|
|
|
@@ -290,6 +599,7 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
290
599
|
| `ce_get_build_run` | Get build run status | `project_id`, `build_run_name` |
|
|
291
600
|
| `ce_create_build_run` | Start a build run | `project_id`, `build_name` |
|
|
292
601
|
| `ce_delete_build_run` | Delete a build run | `project_id`, `build_run_name` |
|
|
602
|
+
| `ce_wait_for_build_run` | Poll until build run succeeds or fails; returns `poll_history` | `project_id`, `build_run_name`, `timeout_seconds` |
|
|
293
603
|
|
|
294
604
|
### Code Engine: Jobs (8)
|
|
295
605
|
|
|
@@ -304,14 +614,17 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
304
614
|
| `ce_create_job_run` | Submit a job run | `project_id`, `job_name` |
|
|
305
615
|
| `ce_delete_job_run` | Delete a job run | `project_id`, `job_run_name` |
|
|
306
616
|
|
|
307
|
-
### Code Engine: Secrets (
|
|
617
|
+
### Code Engine: Secrets (7)
|
|
308
618
|
|
|
309
619
|
| Tool | Description | Key Parameters |
|
|
310
620
|
|------|-------------|----------------|
|
|
311
621
|
| `ce_list_secrets` | List secrets (names + keys only) | `project_id` |
|
|
312
622
|
| `ce_get_secret` | Get secret metadata (no values) | `project_id`, `secret_name` |
|
|
313
623
|
| `ce_create_secret` | Create a secret | `project_id`, `name`, `format`, `data` |
|
|
624
|
+
| `ce_update_secret` | Update an existing secret in-place (PATCH) | `project_id`, `secret_name`, `data` |
|
|
314
625
|
| `ce_delete_secret` | Delete a secret | `project_id`, `secret_name` |
|
|
626
|
+
| `ce_create_tls_secret_from_pem` | Create a TLS secret from PEM files | `project_id`, `secret_name`, `cert_pem_path`, `key_pem_path` |
|
|
627
|
+
| `ce_renew_tls_secret_from_pem` | Renew an existing TLS secret from updated PEM files | `project_id`, `secret_name`, `cert_pem_path`, `key_pem_path` |
|
|
315
628
|
|
|
316
629
|
### Code Engine: ConfigMaps (4)
|
|
317
630
|
|
|
@@ -322,6 +635,29 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
322
635
|
| `ce_create_config_map` | Create a configmap | `project_id`, `name`, `data` |
|
|
323
636
|
| `ce_delete_config_map` | Delete a configmap | `project_id`, `config_map_name` |
|
|
324
637
|
|
|
638
|
+
### Code Engine: Domain Mappings (4)
|
|
639
|
+
|
|
640
|
+
| Tool | Description | Key Parameters |
|
|
641
|
+
|------|-------------|----------------|
|
|
642
|
+
| `ce_list_domain_mappings` | List all custom domain mappings | `project_id` |
|
|
643
|
+
| `ce_get_domain_mapping` | Get status and CNAME target for a mapping | `project_id`, `domain_name` |
|
|
644
|
+
| `ce_create_domain_mapping` | Map a custom domain to an app | `project_id`, `domain_name`, `app_name`, `tls_secret` |
|
|
645
|
+
| `ce_delete_domain_mapping` | Delete a custom domain mapping | `project_id`, `domain_name` |
|
|
646
|
+
|
|
647
|
+
### IBM Cloud IAM (1)
|
|
648
|
+
|
|
649
|
+
| Tool | Description | Key Parameters |
|
|
650
|
+
|------|-------------|----------------|
|
|
651
|
+
| `iam_get_token_info` | Inspect the current IAM token — account, expiry, validity | — |
|
|
652
|
+
|
|
653
|
+
### Procedures — Multi-Step Workflows (3)
|
|
654
|
+
|
|
655
|
+
| Tool | What it does | Key Parameters |
|
|
656
|
+
|------|-------------|----------------|
|
|
657
|
+
| `proc_build_push_deploy` | Build container for linux/amd64 → push → create/update CE app → wait for ready → return URL + `poll_history` | `context_path`, `project_id_or_name`, `app_name`, `image_secret`, `icr_namespace`, `image_tag` (default `latest`), `icr_host` (default `us.icr.io`), `port`, `timeout_seconds` |
|
|
658
|
+
| `proc_setup_custom_domain` | Read PEM files → create TLS secret → create domain mapping → return CNAME target | `project_id_or_name`, `app_name`, `domain_name`, `tls_secret_name`, `cert_pem_path`, `key_pem_path` |
|
|
659
|
+
| `proc_build_run_and_deploy` | Start CE build run → wait for success → create/update app → wait for ready → return URL + `build_poll_history` + `app_poll_history` | `project_id_or_name`, `build_name`, `app_name`, `image_secret`, `port`, `build_timeout_seconds`, `deploy_timeout_seconds` |
|
|
660
|
+
|
|
325
661
|
## 🔐 Environment Variables
|
|
326
662
|
|
|
327
663
|
- `IBMCLOUD_API_KEY`: IBM Cloud API key (required for Code Engine operations)
|
|
@@ -332,9 +668,10 @@ I have a Node.js app in ./my-app with a Dockerfile. Can you:
|
|
|
332
668
|
## 📋 Prerequisites
|
|
333
669
|
|
|
334
670
|
- Node.js v18 or higher
|
|
335
|
-
- Docker or Podman installed
|
|
336
|
-
- IBM Cloud
|
|
337
|
-
|
|
671
|
+
- Docker or Podman installed (for container build/push tools)
|
|
672
|
+
- IBM Cloud API key (for all Code Engine and ICR operations)
|
|
673
|
+
|
|
674
|
+
> The MCP server communicates directly with the IBM Cloud REST API and ICR API. No IBM Cloud CLI or Code Engine plugin is required.
|
|
338
675
|
|
|
339
676
|
## 👩💻 Development
|
|
340
677
|
|
|
@@ -366,10 +703,10 @@ node build/index.js
|
|
|
366
703
|
|
|
367
704
|
### Code Engine Commands Failing
|
|
368
705
|
|
|
369
|
-
1. Verify
|
|
370
|
-
2.
|
|
371
|
-
3. Verify
|
|
372
|
-
4.
|
|
706
|
+
1. Verify your API key is set: check `IBMCLOUD_API_KEY` in your MCP client config
|
|
707
|
+
2. Confirm the region is correct (default `us-south`); set `IBMCLOUD_REGION` if needed
|
|
708
|
+
3. Verify the project ID is valid: use `ce_list_projects` to find it
|
|
709
|
+
4. Check for expired tokens — the server re-fetches IAM tokens automatically; if errors persist, regenerate your API key at [IBM Cloud IAM → API keys](https://cloud.ibm.com/iam/apikeys)
|
|
373
710
|
|
|
374
711
|
## 🛡️ Security
|
|
375
712
|
|
|
@@ -384,7 +721,7 @@ MIT (see `LICENSE`)
|
|
|
384
721
|
|
|
385
722
|
## 🤝 Contributing
|
|
386
723
|
|
|
387
|
-
Contributions are welcome! Please open an issue or submit a pull request.
|
|
724
|
+
Contributions are welcome! Please open an issue or submit a pull request (see [Contributing Guide](./docs/CONTRIBUTING.md)).
|
|
388
725
|
|
|
389
726
|
## 👤 Author
|
|
390
727
|
|