code-engine-mcp-server 1.0.6 → 1.0.7

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 CHANGED
@@ -9,6 +9,9 @@ It enables AI assistants to build, run, push, and deploy containerized workloads
9
9
  [![IBM Cloud](https://img.shields.io/badge/IBM%20Cloud-Code%20Engine-1261FE)](https://cloud.ibm.com/codeengine/overview)
10
10
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=nodedotjs&logoColor=white)](#prerequisites)
11
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
12
+ [![VS Code Marketplace](https://img.shields.io/badge/VS%20Code-Marketplace-007ACC?logo=visualstudiocode&logoColor=white)](https://marketplace.visualstudio.com/items?itemName=MarkusvanKempen.code-engine-mcp)
13
+ [![Open VSX](https://img.shields.io/badge/Open%20VSX-Registry-C160EF?logo=eclipseide&logoColor=white)](https://open-vsx.org/extension/markusvankempen/code-engine-mcp)
14
+ [![npm](https://img.shields.io/badge/npm-code--engine--mcp--server-CB3837?logo=npm&logoColor=white)](https://www.npmjs.com/package/code-engine-mcp-server)
12
15
 
13
16
  ## How It Works
14
17
 
@@ -606,6 +609,7 @@ code-engine-mcp-server/
606
609
  - ✅ TLS secrets from Let's Encrypt / certbot PEM files (`ce_create_tls_secret_from_pem`)
607
610
  - ✅ TLS cert renewal in-place without disrupting domain mappings (`ce_renew_tls_secret_from_pem`)
608
611
  - ✅ Update any secret in-place (`ce_update_secret`)
612
+ - ✅ Refresh ICR pull secret with current API key credentials (`ce_refresh_icr_pull_secret`) — fixes `no_revision_ready` failures caused by stale registry credentials without needing the CLI
609
613
  - ✅ Wait for app deployment or build run to complete (`ce_wait_for_app_ready`, `ce_wait_for_build_run`)
610
614
  - ✅ IAM token info and diagnostics (`iam_get_token_info`)
611
615
  - ✅ Create ICR namespaces via REST API (`icr_create_namespace`)
@@ -617,79 +621,188 @@ code-engine-mcp-server/
617
621
 
618
622
  ## ⚙️ Configuration
619
623
 
620
- ### VS Code IBM Code Engine MCP extension (optional)
624
+ ### Getting an IBM Cloud API key
621
625
 
622
- 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.
626
+ All Code Engine and ICR operations require an IBM Cloud API key. Get one at:
627
+ **[IBM Cloud IAM → API keys](https://cloud.ibm.com/iam/apikeys)** → **Create an IBM Cloud API key**.
623
628
 
624
- 1. Install the extension (from a `.vsix` built with `npm run package` inside `vscode-extension/`, or from the Marketplace when published).
625
- 2. Ensure **Node.js** is installed and `npx` is on your `PATH`.
626
- 3. Open **Settings** and search for **IBM Code Engine MCP**, or edit `settings.json` directly:
627
- - `codeEngineMcp.apiKey` — your IBM Cloud API key (**required**; until this is set, the extension contributes no MCP server).
628
- - `codeEngineMcp.region` — IBM Cloud region (optional, default `us-south`). Passed as `IBMCLOUD_REGION` to the server.
629
+ Store the key somewhere safe (password manager). You will paste it into one of the configuration paths below.
629
630
 
630
- 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).
631
+ ---
632
+
633
+ ### Path A — VS Code extension (recommended)
634
+
635
+ The [IBM Code Engine MCP extension](https://marketplace.visualstudio.com/items?itemName=MarkusvanKempen.code-engine-mcp) handles everything: server startup, API key storage, and MCP registration — no manual `mcp.json` editing required.
636
+
637
+ **Install from the Marketplace:**
638
+
639
+ | IDE / Platform | Install link |
640
+ |---|---|
641
+ | VS Code | [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=MarkusvanKempen.code-engine-mcp) |
642
+ | Cursor / Theia / Gitpod / Codium | [open-vsx.org](https://open-vsx.org/extension/markusvankempen/code-engine-mcp) |
643
+ | From a local `.vsix` | **Command Palette** → **Extensions: Install from VSIX…** |
644
+
645
+ **Set your API key (required before any tool works):**
646
+
647
+ 1. Open the **IBM Code Engine MCP** sidebar panel (cloud icon in the Activity Bar)
648
+ 2. Paste your IBM Cloud API key and click **Save**
649
+ _(The key is stored in VS Code global settings — encrypted by the OS keychain, never in a plaintext file)_
650
+ 3. Optionally change the region (default: `us-south`) in the same panel
651
+ 4. Click **Configure MCP** — this writes the server entry to the global `mcp.json` and restarts VS Code's MCP server list
652
+ 5. Click **Run Diagnostics** to confirm everything is wired up:
653
+ - ✅ Node.js found on PATH
654
+ - ✅ API key configured
655
+ - ✅ MCP server registered
656
+ - ✅ Tool list discovered
657
+
658
+ After step 4 you can open GitHub Copilot Chat and immediately ask:
659
+ > *"List all my Code Engine projects"*
660
+
661
+ > **Tip:** If Copilot can't see the tools after installing, run **Command Palette → Reload Window** once.
631
662
 
632
663
  More detail: [vscode-extension/README.md](./vscode-extension/README.md).
633
664
 
634
665
  ---
635
666
 
636
- ### 1) GitHub Copilot (VS Code) `mcp.json` (workspace)
667
+ ### Path B Pure MCP config (no extension)
668
+
669
+ Use this path with **any** MCP-capable client: GitHub Copilot without the extension, Cline, Claude Desktop, Cursor, etc.
670
+
671
+ #### Where to put the API key (choose one approach)
637
672
 
638
- Copy `mcp.example.json` to `.vscode/mcp.json` in your workspace root:
673
+ **Option 1 Shell environment variable (most secure)**
674
+
675
+ Copy the provided template and fill in your key:
639
676
 
640
677
  ```bash
641
- cp mcp.example.json ../.vscode/mcp.json
678
+ cp .env.example .env # copy template (already in .gitignore)
679
+ # edit .env → set IBMCLOUD_API_KEY=your-key
680
+ source .env # load into current shell session
642
681
  ```
643
682
 
644
- Then edit `.vscode/mcp.json` and replace the placeholder with your IBM Cloud API key:
683
+ Or add the export permanently to your shell profile so every new terminal has it:
684
+
685
+ ```bash
686
+ # ~/.zshrc or ~/.bash_profile
687
+ export IBMCLOUD_API_KEY="your-ibm-cloud-api-key-here"
688
+ ```
689
+
690
+ See [.env.example](.env.example) for all available variables (`IBMCLOUD_REGION`, `CONTAINER_RUNTIME`, `DEBUG`).
691
+
692
+ Then reference the variable in the MCP config without embedding the value:
645
693
 
646
694
  ```json
647
695
  {
648
- "servers": {
649
- "code-engine": {
650
- "type": "stdio",
651
- "command": "node",
652
- "args": [
653
- "${workspaceFolder}/code-engine-mcp-server/build/index.js"
654
- ],
655
- "env": {
656
- "IBMCLOUD_API_KEY": "your-ibm-cloud-api-key-here"
657
- }
658
- }
696
+ "servers": {
697
+ "code-engine": {
698
+ "type": "stdio",
699
+ "command": "npx",
700
+ "args": ["-y", "code-engine-mcp-server@latest"],
701
+ "env": {
702
+ "IBMCLOUD_API_KEY": "${env:IBMCLOUD_API_KEY}",
703
+ "IBMCLOUD_REGION": "us-south"
704
+ }
659
705
  }
706
+ }
660
707
  }
661
708
  ```
662
709
 
663
- Restart the server: **Cmd+Shift+P** -> **"MCP: Restart Server"** -> `code-engine`.
710
+ > `${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.
664
711
 
665
- > **Security:** Add `.vscode/mcp.json` to your `.gitignore` to avoid committing your API key.
712
+ **Option 2 VS Code input variable (prompted on connect)**
666
713
 
667
- Get your API key at [IBM Cloud IAM API keys](https://cloud.ibm.com/iam/apikeys).
714
+ VS Code can prompt you for the API key when it starts the server great for shared machines:
715
+
716
+ ```json
717
+ {
718
+ "inputs": [
719
+ {
720
+ "id": "ibmcloud-api-key",
721
+ "type": "promptString",
722
+ "description": "IBM Cloud API key",
723
+ "password": true
724
+ }
725
+ ],
726
+ "servers": {
727
+ "code-engine": {
728
+ "type": "stdio",
729
+ "command": "npx",
730
+ "args": ["-y", "code-engine-mcp-server@latest"],
731
+ "env": {
732
+ "IBMCLOUD_API_KEY": "${input:ibmcloud-api-key}",
733
+ "IBMCLOUD_REGION": "us-south"
734
+ }
735
+ }
736
+ }
737
+ }
738
+ ```
739
+
740
+ **Option 3 — Inline value (simplest, least secure)**
741
+
742
+ Paste the key directly. **Never commit this file to git.**
743
+
744
+ ```json
745
+ {
746
+ "servers": {
747
+ "code-engine": {
748
+ "type": "stdio",
749
+ "command": "npx",
750
+ "args": ["-y", "code-engine-mcp-server@latest"],
751
+ "env": {
752
+ "IBMCLOUD_API_KEY": "your-ibm-cloud-api-key-here",
753
+ "IBMCLOUD_REGION": "us-south"
754
+ }
755
+ }
756
+ }
757
+ }
758
+ ```
759
+
760
+ > **Security:** Add the config file to `.gitignore`. For workspace configs, use `${env:...}` or `${input:...}` instead of inline values.
668
761
 
669
762
  ---
670
763
 
671
- ### 2) Cline (VS Code Extension)
764
+ #### 1) GitHub Copilot (VS Code) — workspace `mcp.json`
765
+
766
+ Create `.vscode/mcp.json` in your workspace root (or copy `mcp.example.json`):
767
+
768
+ ```bash
769
+ cp mcp.example.json .vscode/mcp.json
770
+ echo '.vscode/mcp.json' >> .gitignore
771
+ ```
772
+
773
+ Paste one of the API key options above. Then restart the server:
774
+ **Cmd+Shift+P** → **MCP: Restart Server** → `code-engine`.
775
+
776
+ 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.
777
+
778
+ ---
672
779
 
673
- 1. Open VSCode Settings (Cmd/Ctrl + ,)
674
- 2. Search for "Cline: MCP Settings"
675
- 3. Click "Edit in settings.json"
676
- 4. Add the configuration:
780
+ #### 2) Cline (VS Code Extension)
781
+
782
+ 1. Open VS Code Settings (`Cmd+,`)
783
+ 2. Search for **Cline: MCP Settings** → **Edit in settings.json**
784
+ 3. Add:
677
785
 
678
786
  ```json
679
787
  {
680
788
  "cline.mcpServers": {
681
789
  "code-engine": {
682
- "command": "node",
683
- "args": ["/absolute/path/to/code-engine-mcp-server/build/index.js"],
790
+ "command": "npx",
791
+ "args": ["-y", "code-engine-mcp-server@latest"],
684
792
  "env": {
685
- "IBMCLOUD_API_KEY": "your-api-key-here"
793
+ "IBMCLOUD_API_KEY": "your-api-key-here",
794
+ "IBMCLOUD_REGION": "us-south"
686
795
  }
687
796
  }
688
797
  }
689
798
  }
690
799
  ```
691
800
 
692
- ### 3) Claude Desktop
801
+ > Prefer `${env:IBMCLOUD_API_KEY}` if your shell exports the key, so it never appears in `settings.json`.
802
+
803
+ ---
804
+
805
+ #### 3) Claude Desktop
693
806
 
694
807
  Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
695
808
 
@@ -697,22 +810,29 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
697
810
  {
698
811
  "mcpServers": {
699
812
  "code-engine": {
700
- "command": "node",
701
- "args": ["/absolute/path/to/code-engine-mcp-server/build/index.js"],
813
+ "command": "npx",
814
+ "args": ["-y", "code-engine-mcp-server@latest"],
702
815
  "env": {
703
- "IBMCLOUD_API_KEY": "your-api-key-here"
816
+ "IBMCLOUD_API_KEY": "your-api-key-here",
817
+ "IBMCLOUD_REGION": "us-south"
704
818
  }
705
819
  }
706
820
  }
707
821
  }
708
822
  ```
709
823
 
710
- ## One-Click Install
824
+ > Restart Claude Desktop after saving. The server starts on demand when Claude needs a tool.
711
825
 
712
- Use the published package from npm or browse the MCP Registry listing:
826
+ ## Install & Registry Links
827
+
828
+ | Platform | Link |
829
+ |---|---|
830
+ | **npm** (MCP server package) | [code-engine-mcp-server](https://www.npmjs.com/package/code-engine-mcp-server) |
831
+ | **VS Code Marketplace** (extension) | [MarkusvanKempen.code-engine-mcp](https://marketplace.visualstudio.com/items?itemName=MarkusvanKempen.code-engine-mcp) |
832
+ | **Open VSX Registry** (Theia / Gitpod / Cursor) | [markusvankempen.code-engine-mcp](https://open-vsx.org/extension/markusvankempen/code-engine-mcp) |
833
+ | **MCP Registry** | [io.github.markusvankempen/code-engine-mcp-server](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.markusvankempen%2Fcode-engine-mcp-server) |
713
834
 
714
- - [npm package: code-engine-mcp-server](https://www.npmjs.com/package/code-engine-mcp-server)
715
- - [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)
835
+ 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).
716
836
 
717
837
  ## 💬 Example Prompts
718
838
 
@@ -776,7 +896,7 @@ Tell me what CNAME value to set in DNS.
776
896
 
777
897
  ## 🛠️ Available Tools
778
898
 
779
- 62 tools total: 9 container tools + 4 ICR tools + 45 Code Engine tools + 1 IAM tool + 3 procedures.
899
+ 63 tools total: 9 container tools + 4 ICR tools + 46 Code Engine tools + 1 IAM tool + 3 procedures.
780
900
 
781
901
  > **Procedures** bundle multiple tools into a single call. Use them for common end-to-end workflows.
782
902
 
@@ -853,7 +973,7 @@ Tell me what CNAME value to set in DNS.
853
973
  | `ce_create_job_run` | Submit a job run | `project_id`, `job_name` |
854
974
  | `ce_delete_job_run` | Delete a job run | `project_id`, `job_run_name` |
855
975
 
856
- ### Code Engine: Secrets (7)
976
+ ### Code Engine: Secrets (8)
857
977
 
858
978
  | Tool | Description | Key Parameters |
859
979
  |------|-------------|----------------|
@@ -862,6 +982,7 @@ Tell me what CNAME value to set in DNS.
862
982
  | `ce_create_secret` | Create a secret | `project_id`, `name`, `format`, `data` |
863
983
  | `ce_update_secret` | Update an existing secret in-place (PATCH) | `project_id`, `secret_name`, `data` |
864
984
  | `ce_delete_secret` | Delete a secret | `project_id`, `secret_name` |
985
+ | `ce_refresh_icr_pull_secret` | Delete and recreate an ICR registry pull secret using the server's own API key — fixes stale-credential failures without needing the CLI | `project_id`, `secret_name` (default: `icr-pull-secret`), `icr_host` |
865
986
  | `ce_create_tls_secret_from_pem` | Create a TLS secret from PEM files | `project_id`, `secret_name`, `cert_pem_path`, `key_pem_path` |
866
987
  | `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` |
867
988