Deploy to IBM Code Engine from Cursor, Copilot, Claude & Cline. Build, push, deploy via MCP.
This MCP server deploys containers to IBM Code Engine and provides an MCP interface for building, pushing, and deploying from tools such as Cursor, Copilot, Claude, and Cline. The repository is described as an MCP server for Model Context Protocol workflows focused on container deployment to IBM Cloud.
🛠️ Key Features
Deploy to IBM Code Engine
Build, push, and deploy via MCP
Container-oriented workflow (Docker/Podman)
Uses MCP / Model Context Protocol terminology
🚀 Use Cases
Deploy containers to IBM Cloud Code Engine
Integrate deployment steps into AI agent tooling (Cursor, Copilot, Claude, Cline)
Support DevOps automation for container deployment
⚡ Developer Benefits
Standardize deployment access through an MCP server
Aligns with IBM Cloud components mentioned: IBM Container Registry (ICR) and Code Engine
Topics indicate implementation areas such as TypeScript and VS Code extension
⚠️ Limitations
Source data does not specify authentication methods, supported runtimes beyond container deployment, or the exact tool list (toolCount not provided).
Code Engine MCP Server — IBM Cloud rocket and container logo
MCP server for IBM Code Engine — build, push, and deploy containers from Cursor, Copilot, Claude, and Cline using natural language.
Current release: v1.7.8 — 28 tools instead of 112 (one tool per resource with an action field, same capability, old names still work), a shared local HTTP server for the VS Code extension, a web admin UI with a Remote client tab (test tools, logging, users and API keys, events), MCP Remote Config inside VS Code, and a check that the server you point at really is a code-engine MCP server. See CHANGELOG.md and the tool reference.
flowchart TD
A([AI Assistant\nCopilot / Claude / Cline / Bob]) -->|MCP JSON-RPC| B[Code Engine MCP Server]
B --> C{Tool Category}
C -->|Container Tools| D[Docker / Podman]
C -->|Registry Tools| E[IBM Container Registry\nus.icr.io]
C -->|Code Engine Tools| F[IBM Code Engine\nREST API]
C -->|Procedures| G[Multi-step Workflows]
D -->|build / push / validate| E
E -->|image reference| F
G -->|proc_build_push_deploy| D
G -->|proc_apply_manifest| F
F --> H[(Projects\nApps\nBuilds\nJobs\nSecrets\nDomains)]
H -->|ready| I([Live App\nhttps://app.region.codeengine.appdomain.cloud])
style A fill:#1261FE,color:#fff
style B fill:#0f3460,color:#fff
style G fill:#7b2d8b,color:#fff
style I fill:#198038,color:#fff
✨ What You Get
28 tools, one per resource.ce_app, ce_job, ce_secret, … each take an action (list, get, create, delete, …). Every earlier capability is still there; see the tool reference.
Container workflow tools for Docker or Podman (local_container, dockerfile)
IBM Container Registry (icr) and the whole Code Engine surface: projects, apps, jobs, builds, secrets, config maps, domains, bindings, functions, fleets
Multi-step procedures: build, push and deploy in one call (proc_build_push_deploy), custom domains, declarative manifests
One server, many clients. Run it over stdio, or as an HTTP server that your IDE, assistants, the web UI and the VS Code extension all share
Web admin UI (/admin): overview, activity, users, API keys, runtime settings, and a Remote client tab that tests the tools and configures the server (logging, users and keys, events)
MCP-ready setup for GitHub Copilot, Cursor, Cline, Bob, Windsurf, Antigravity, Claude Desktop, and the VS Code extension in vscode-extension/ (including MCP Remote Config)
MCP Activity Dashboard — live timeline of tool calls, session grouping, deploy outcome highlights, and a Deployments inventory tab
Live activity logging — optional JSONL event stream for every MCP tool call (MCP_ACTIVITY_* env vars)
🚀 Quick Start
bash
# 1) Install dependencies
npm install
# 2) Build the server
npm run build
# 3) Run once to verify
node build/index.js
Then configure your MCP client using one of the examples in the Configuration section below.
🤖 The Agentic Experience (No Docker/Code Engine Lingo Needed)
The true power of this MCP server is that you don't need to know Docker or Code Engine commands. You can simply state your goal, and the LLM will discover the environment, run the pipeline, and fix issues autonomously.
Here is an example interaction from a real session:
User:
"I have an app in the developer-splash folder. Deploy it to my Code Engine project."
Assistant's Autonomous Thought Process:
Discovery: "Let me check what projects and namespaces exist... Found project my-project and namespace my-namespace."
Prerequisites: "No pull secret in this project yet. I'll get the API key from the .env file and create the secret icr-pull-secret."
Execution: "Now I'll run the full pipeline: build → push → deploy → wait."
Validation: "It's deployed but stuck at 'deploying'. Let me check the logs... The container is running but the readiness probe is failing."
Self-Correction: "Ah, the sed pattern in the Dockerfile didn't match nginx alpine's default config format for port 80. I'll fix the Dockerfile with a regex-safe sed and rebuild."
Completion: "App is live! 🎉 Status: ready."
Assistant Response to User:
"Your app is deployed and live at: https://developer-splash.<subdomain>.<region>.codeengine.appdomain.cloud. I had to fix a minor port configuration issue in your Dockerfile, but it is successfully running now!"
With this MCP server, the AI acts as an expert DevOps engineer pairing with you.
📊 MCP Activity Dashboard (v1.4.0)
See what your AI assistant is doing in real time — tool calls, idle gaps between steps, deploy outcomes, and live app URLs.
flowchart LR
A[MCP tool call] -->|MCP_ACTIVITY_ENABLED| B[events.jsonl]
B --> C{Dashboard}
C -->|VS Code extension| D[Activity tab]
C -->|Browser| E[localhost:8767]
D --> F[Deployments tab\ninventory + actions]
Activity logging (on by default)
Since v1.6.0 the server logs every tool start/finish to ~/.code-engine-mcp/activity/events.jsonl — input summaries, pipeline sub-steps (proc_build_push_deploy), result highlights, and optional HTTP smoke-test labels. API keys, passwords, TLS keys, env var values, and secret payloads are redacted. The file rotates at 5 MB.
Optional env in your MCP client config:
json
"MCP_ACTIVITY_ENABLED":"false","MCP_ACTIVITY_EVENTS_PATH":"/custom/path/events.jsonl","MCP_ACTIVITY_SESSION_ID":"session:my-chat-001","MCP_ACTIVITY_CHAT_LABEL":"Deploy Star Wars splash"
In the VS Code extension, turn logging off with codeEngineMcp.activityEnabled. Restart the MCP server after changing env.
See .env.example for all MCP_ACTIVITY_* variables.
Open the dashboard
Method
How
VS Code extension
Command Palette → IBM Code Engine MCP: Open MCP Activity Dashboard
On by default in the browser; toggle in-panel or set codeEngineMcp.activityLiveRefresh (extension)
The Activity tab shows a session timeline with tool duration, idle gaps, and a task-outcome banner (status, image, live URL). The Deployments tab lists projects and apps from Code Engine and supports get-details, redeploy, and delete via MCP tools.
Example chat prompt:
"I have a Star Wars splash page in examples/starwars-splash. Deploy it to Code Engine using only MCP tools — build for linux/amd64, push to my ICR namespace, and deploy to my Code Engine project. Show me the live URL when ready."
Open the Activity Dashboard while the assistant runs to watch proc_build_push_deploy progress step by step.
Deploy Your First App
This walks through deploying the included Star Wars splash page example — a static nginx container — entirely through the MCP server.
Apple Silicon users: always build with --platform linux/amd64. Code Engine runs amd64 only.
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.
Deploy us.icr.io/my-namespace/starwars-splash:v1.0.0 to Code Engine project <project-id>
as app "starwars-splash" using pull secret icr-pull-secret, min 1 instance
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.
5a — Get a Let's Encrypt certificate (certbot)
bash
# Install once
brew install certbot
# Request cert — certbot will print a DNS TXT challenge valuemkdir -p ~/certbot/{config,work,logs}
/opt/homebrew/bin/certbot certonly --manual --preferred-challenges dns \
-d <your-domain> --agree-tos --no-eff-email --email you@example.com \
--config-dir ~/certbot/config --work-dir ~/certbot/work --logs-dir ~/certbot/logs
Certbot will pause and ask you to add a TXT record:
Verify propagation, then press Enter. Certbot writes:
~/certbot/config/live/<your-domain>/fullchain.pem
~/certbot/config/live/<your-domain>/privkey.pem
5b — Create the TLS secret in Code Engine
Ask your assistant:
code
Create a TLS secret called starwars-tls in project <project-id>
using cert ~/certbot/config/live/myapp.example.com/fullchain.pem
and key ~/certbot/config/live/myapp.example.com/privkey.pem
This calls ce_create_tls_secret_from_pem — reads the PEM files from disk and stores them as a Code Engine tls secret.
Use the cname_target value returned in 5c (it uses the custom. prefix, not the app name).
Once DNS propagates, https://<your-domain> serves the app with a valid TLS certificate.
Certificate renewal: Let's Encrypt certs expire after 90 days. Re-run certbot to get updated PEM files, then ask Copilot to run ce_create_tls_secret_from_pem with moderenew — it patches the existing secret in-place so your domain mapping continues working without any changes. ce_renew_tls_secret_from_pem still works if called directly.
Full one-shot prompt
code
I have a Star Wars splash page in examples/starwars-splash.
Build it for linux/amd64 as us.icr.io/my-namespace/starwars-splash:v1.0.0,
push it, then deploy it to Code Engine project <project-id> with pull secret icr-pull-secret.
Tell me the public URL and confirm the instance is running.
🔒 Security & Transport Model
Two kinds of credential
IBM Cloud API key (IBMCLOUD_API_KEY): how the server talks to IBM Cloud. It stays on the server process. Callers never receive it.
MCP caller credentials: who may call a tool on this server. They are never sent to IBM Cloud.
the web admin session (/admin, built-in user admin with ADMIN_PASSWORD),
a user, sent as Authorization: Basic user:password (server_users),
an MCP API key, sent as Authorization: Bearer cemcp_… (server_api_keys; the secret is shown once).
Each credential has the scopes read, write, admin. Over stdio there are no headers; set MCP_API_KEY, or MCP_USERNAME and MCP_PASSWORD, in the server environment. Details: Tool scope and authentication.
POST/GET/DELETE /mcp (Streamable HTTP), GET /sse and POST /messages (legacy SSE), /health, /admin, /test, /tools, /log, /docs
One server is better than several. A stdio server is started by each client, so every IDE window gets its own process with its own memory. Its audit trace, rate limits, sessions and runtime settings are not visible to the web UI of another process. Run one HTTP server and point every client at it when you want the trace, logging, users, keys and settings to line up. The VS Code extension does exactly that by default.
Local server hardening
Bind to 127.0.0.1 unless the server is meant to be remote. On a public bind (HOST=0.0.0.0, a container) the built-in admin is disabled until ADMIN_PASSWORD is set.
MCP_LOCAL_ONLY=true makes the server answer only requests whose Host is localhost, 127.0.0.1 or [::1], so a web page that rebinds its own name to 127.0.0.1 cannot reach it. The VS Code extension sets it for the server it starts. Leave it off behind a reverse proxy.
The admin cookie is HttpOnly and SameSite=Strict; five failed sign-ins lock an address out for ten minutes; the settings export leaves secrets out.
🌐 Host Any MCP Server on Code Engine
You can use this MCP server to deploy another MCP server to Code Engine — no CLI, no Dockerfile, no YAML. The key ingredient is supergateway: a tiny bridge that wraps any STDIO-based MCP server as an HTTP + SSE endpoint, making it accessible to any remote client.
Deploy a hosted MCP fetch server to my Code Engine project <project-id>.
Use image docker.io/supercorp/supergateway on port 8000.
Startup args: --stdio "npx -y @tokenizin/mcp-npx-fetch" --outputTransport sse
Name it "mcp-fetch-server". No pull secret needed.
npx @modelcontextprotocol/inspector
# Connect via SSE → paste the Code Engine URL
Once connected, you will see the fetch tool listed and can invoke it directly from the inspector.
Full one-shot prompt
code
Deploy a hosted MCP fetch server to my Code Engine project <project-id>.
Use image docker.io/supercorp/supergateway on port 8000 with no pull secret.
run_args: --stdio "npx -y @tokenizin/mcp-npx-fetch" --outputTransport sse
Name it "mcp-fetch-server", wait for it to be ready, and give me the /sse URL
so I can add it to my mcp.json.
This server:server_settings, server_access, server_users, server_api_keys, server_log
Workspace:write_or_modify_file
Every tool has an outputSchema, every result a next hint, and wrong calls explain what to fix. See Available Tools and the tool reference.
Web admin UI and operations
Sign in at /admin: Overview, Remote client (call any tool from a schema-driven form, switch the activity log and audit trace on, create users and MCP API keys, listen for events), Activity, Events, Users, API keys, Runtime
Tool scope and authentication per tool, rate limit, protocol switches, settings and log export (no secrets)
VS Code extension
Setup and diagnostics sidebar, Configure MCP for every IDE, MCP Remote Config panel, Activity Dashboard, Receipt Visualizer
Choice of Shared HTTP server (default) or stdio, or a remote server URL, with a check that the server is a code-engine MCP server
Set your API key (required before any tool works):
Open the IBM Code Engine MCP sidebar panel (cloud icon in the Activity Bar)
Paste your IBM Cloud API key and click Save (The key is stored in VS Code SecretStorage, never in a plaintext file)
Optionally change the region (default: us-south) in the same panel
Under Server connection → This computer pick how the server runs:
Shared HTTP server (default): the extension starts one server on 127.0.0.1:8787 and chat, the IDE MCP list, the web UI and MCP Remote Config all use it. Sign in to the web UI as admin / admin (change it with the setting codeEngineMcp.localAdminPassword).
stdio: each IDE window starts its own process.
or Remote server: the URL of a shared server on any host.
Click Configure MCP — this writes the code-engine entry (the same connection the extension uses) into VS Code, Cursor, Bob, Windsurf, Cline, Antigravity, and Claude Desktop configs. Other servers in those files are kept.
Click Run Diagnostics to confirm everything is wired up:
✅ Node.js found on PATH
✅ API key configured
✅ MCP server registered
✅ Tool list discovered (the heading shows the count, for example Discovered Tools (28))
After step 5 you can open GitHub Copilot Chat and immediately ask:
"List all my Code Engine projects"
Tip: If Copilot can't see the tools after installing, run Command Palette → Reload Window once.
${env:VARIABLE} is VS Code's input substitution syntax — it reads the value from your shell environment at startup so your API key is never stored in the file.
Option 2 — VS Code input variable (prompted on connect)
VS Code can prompt you for the API key when it starts the server — great for shared machines:
json
{"inputs":[{"id":"ibmcloud-api-key","type":"promptString","description":"IBM Cloud API key","password":true}],"servers":{"code-engine":{"type":"stdio","command":"npx","args":["-y","code-engine-mcp-server@latest"],"env":{"IBMCLOUD_API_KEY":"${input:ibmcloud-api-key}","IBMCLOUD_REGION":"us-south"}}}}
Option 3 — Inline value (simplest, least secure)
Paste the key directly. Never commit this file to git.
Paste one of the API key options above. Then restart the server:
Cmd+Shift+P → MCP: Restart Server → code-engine.
Alternatively, use the global MCP config at ~/Library/Application Support/Code/User/mcp.json (macOS) so the server is available in every workspace without a per-project file.
2) Cline (VS Code Extension)
Open VS Code Settings (Cmd+,)
Search for Cline: MCP Settings → Edit in settings.json
Run the server once in HTTP mode and let every client connect to it. The same steps work on your laptop and on IBM Code Engine, Render, Fly.io, a VM or any container host. The server is a plain Node HTTP app.
On a public host use HOST=0.0.0.0 and always set ADMIN_PASSWORD (the built-in admin is disabled without it). Put TLS in front of it.
2. Security model
The IBM Cloud API key lives on the server (environment variable, or stored with server_settingssecrets). Callers never send or receive it.
Callers authenticate to the server with a user (Authorization: Basic …), an MCP API key (Authorization: Bearer cemcp_…) or the admin session cookie. Issue them in /admin or with server_users and server_api_keys.
Scopes read, write, admin and the auth mode (open, writes, all) decide what each caller may do: docs/TOOL_ACCESS.md.
3. Client configuration
VS Code, Cursor, Windsurf and others that speak Streamable HTTP (mcp.json):
The VS Code extension writes these entries for you (Setup → Server connection, then Configure MCP). See docs/REMOTE_MCP_CONNECTION.md for every IDE.
4. Check it
GET /health answers without credentials (?format=json for scripts; the JSON names the service code-engine-mcp-server). Open /admin to see tool counts, the call log and settings.
Prefer ${env:IBMCLOUD_API_KEY} if your shell exports the key, so it never appears in settings.json.
The VS Code extension is the easiest starting point — it handles server startup, API key storage, and MCP registration automatically. Use the npm package directly if you prefer a manual MCP config (Cline, Claude Desktop, Cursor, or any other client).
💬 Example Prompts
Detect Container Runtime
Ask your assistant:
code
Can you detect which container runtime I have installed?
Build a Container Image
Ask your assistant:
code
Build a container image from ./Dockerfile with the name myapp:latest
Test Container Locally
Ask your assistant:
code
Test the myapp:latest image locally on port 8080
Push to Registry
Ask your assistant:
code
Push myapp:latest to icr.io/my-namespace/myapp:latest
List Code Engine Projects
Ask your assistant:
code
List all my Code Engine projects
Complete Workflow
Ask your assistant:
code
I have a Node.js app in ./my-app with a Dockerfile. Can you:
1. Build it as myapp:v1.0.0
2. Test it locally on port 3000
3. Push it to icr.io/my-namespace/myapp:v1.0.0
4. Deploy it to my Code Engine project "production"
5. Show me the application URL
Custom Domain
Ask your assistant:
code
Create a TLS secret called my-tls in project <project-id>
using cert ~/certbot/config/live/example.com/fullchain.pem
and key ~/certbot/config/live/example.com/privkey.pem.
Then map domain example.com to app my-app using that secret.
Tell me what CNAME value to set in DNS.
🛠️ Available Tools
The server publishes 28 tools. Resource tools (ce_app, ce_job, ce_secret, …) take an action field, so one tool covers list, get, create, update, delete and the other operations of that resource. The earlier 112 single-purpose tool names (ce_list_applications, ce_create_job, …) still work when called by name; they are just hidden from tools/list to keep the model's tool menu short.
Call describe_server first when unsure, and get_schema with a tool name for the exact fields of each action. The full list of actions and their required fields is in the tool reference.
Read-only diagnostics for one Code Engine app: running instances, logs, Kubernetes events (why it will not start), and revisions (what to roll back to)
PROCEDURE: Full container pipeline in one step — auto-detects Podman or Docker, builds for linux/amd64, pushes to IBM Container Registry (ICR), creates or updates a Code Engine application, waits for ready, and returns the public URL
This MCP server's own call log and outbound event subscription
Kind:read-only tools only look; writes creates or changes something; can delete or stop means at least one action removes or stops something, so an assistant should confirm those.
🔐 Environment Variables
IBM Cloud
IBMCLOUD_API_KEY: IBM Cloud API key (required for Code Engine and registry operations)
IBMCLOUD_REGION: default IBM Cloud region (optional, default us-south)
CONTAINER_RUNTIME: force docker or podman
HTTP mode and web UI
Variable
Default
Purpose
MCP_MODE
stdio
set to http to serve /mcp, /sse and the web UI
PORT
8787
listen port
HOST
127.0.0.1
bind address; 0.0.0.0 makes it public
ADMIN_USER
admin
built-in admin name
ADMIN_PASSWORD
admin locally
admin password; required on a public bind
MCP_LOCAL_ONLY
off
true: answer only requests addressed to localhost, 127.0.0.1, [::1]
where users and keys, tool policy and settings are saved
Caller identity over stdio
MCP_API_KEY, or MCP_USERNAME and MCP_PASSWORD: the credential the stdio process acts as (stdio has no headers)
Activity Dashboard (on by default since v1.6.0): tool calls are logged to ~/.code-engine-mcp/activity/events.jsonl; set MCP_ACTIVITY_ENABLED=false to turn it off. See MCP Activity Dashboard and .env.example.
Optional addon:PROVENANCE_* variables enable signed receipts (off by default). See Optional addon: Provenance at the end of this README.
📋 Prerequisites
Node.js v18 or higher
Docker or Podman installed (for container build/push tools)
IBM Cloud API key (for all Code Engine and ICR operations)
The MCP server communicates directly with the IBM Cloud REST API and ICR API. No IBM Cloud CLI or Code Engine plugin is required.
👩💻 Development
bash
# Install, build, and test (mise loads Node from mise.toml)
mise run install
mise run test-all # server unit tests, every tool smoke call, extension tests
mise run test-extension # extension typecheck + IDE config tests# Run in development mode
npm run dev
🧪 Troubleshooting
Server Not Connecting
Verify the path in configuration is absolute
Check Node.js is in PATH: node --version
Verify build output exists: ls build/index.js
Test manually: node build/index.js
Docker/Podman Commands Failing
Verify installation: docker --version or podman --version
Check Docker daemon is running
Verify permissions (add user to docker group if needed)
Code Engine Commands Failing
Verify your API key is set: check IBMCLOUD_API_KEY in your MCP client config
Confirm the region is correct (default us-south; eu-es is included). Set IBMCLOUD_REGION if needed
Verify the project ID is valid: use ce_list_projects to find it
Check for expired tokens — the server re-fetches IAM tokens automatically; if errors persist, regenerate your API key at IBM Cloud IAM → API keys
Core observability for MCP workflows. Unlike provenance (signed receipts), activity logging is lightweight and on by default (secrets redacted). Set MCP_ACTIVITY_ENABLED=false to turn it off.
No env is required. The server creates the events file on the first tool call. Use MCP_ACTIVITY_SESSION_ID and MCP_ACTIVITY_CHAT_LABEL to label sessions in the dashboard dropdown.
Troubleshooting: If the dashboard shows no new sessions, check that MCP_ACTIVITY_ENABLED is not false in the MCP server env and that MCP_ACTIVITY_EVENTS_PATH (if set) matches the file the dashboard reads. Restart the MCP server, and click Show all activity if you previously cleared the view.
Optional addon: Provenance
Not part of core MCP functionality. The Code Engine MCP server deploys, builds, and manages apps without provenance. The provenance addon is an experimental optional layer that emits signed receipts for selected tool actions (default: off).
Enable in code-engine-mcp-server/.env (PROVENANCE_ENABLED=true), restart MCP. With provenance on, proc_build_push_deploy returns provenance_receipts in its JSON response.
Example chat prompt (addon):
code
Using only Code Engine MCP tools, deploy examples/startrek-splash.
Provenance on — show provenance_receipts, verify with verify-receipt.mjs, and give me the live URL.