ibmcloud-mcp-server 1.0.1

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 ADDED
@@ -0,0 +1,233 @@
1
+ # IBM Cloud CLI MCP Server
2
+
3
+ Comprehensive MCP server wrapping the IBM Cloud CLI for Claude Code. Provides 80+ tools covering all major IBM Cloud services and operations.
4
+
5
+ ## Features
6
+
7
+ - **Authentication** - Login, logout, target, regions
8
+ - **Resource Management** - Service instances, keys, resource groups
9
+ - **Cloud Foundry** - Apps, services, routes, marketplace
10
+ - **Kubernetes** - Clusters, workers, worker pools, zones
11
+ - **Container Registry** - Namespaces, images, quotas
12
+ - **IAM** - Users, API keys, service IDs, access groups
13
+ - **Catalog & Billing** - Service catalog, usage, billing
14
+
15
+ ## Tool Categories
16
+
17
+ ### Authentication (8 tools)
18
+ | Tool | Description |
19
+ |------|-------------|
20
+ | `ibmcloud_login` | Login with API key or SSO |
21
+ | `ibmcloud_logout` | Logout from IBM Cloud |
22
+ | `ibmcloud_target` | Set target region/resource group |
23
+ | `ibmcloud_api` | View/set API endpoint |
24
+ | `ibmcloud_regions` | List available regions |
25
+ | `ibmcloud_account_show` | Show current account |
26
+ | `ibmcloud_account_list` | List accessible accounts |
27
+ | `ibmcloud_config_list` | List CLI configuration |
28
+
29
+ ### Resource Management (14 tools)
30
+ | Tool | Description |
31
+ |------|-------------|
32
+ | `ibmcloud_resource_groups` | List resource groups |
33
+ | `ibmcloud_resource_group_create` | Create resource group |
34
+ | `ibmcloud_resource_service_instances` | List service instances |
35
+ | `ibmcloud_resource_service_instance` | Get instance details |
36
+ | `ibmcloud_resource_service_instance_create` | Create instance |
37
+ | `ibmcloud_resource_service_instance_delete` | Delete instance |
38
+ | `ibmcloud_resource_service_instance_update` | Update instance |
39
+ | `ibmcloud_resource_service_keys` | List service keys |
40
+ | `ibmcloud_resource_service_key` | Get key details |
41
+ | `ibmcloud_resource_service_key_create` | Create service key |
42
+ | `ibmcloud_resource_service_key_delete` | Delete service key |
43
+ | `ibmcloud_resource_search` | Search resources |
44
+ | `ibmcloud_resource_tags` | List tags |
45
+ | `ibmcloud_resource_tag_attach` | Attach tags |
46
+
47
+ ### Cloud Foundry (20 tools)
48
+ | Tool | Description |
49
+ |------|-------------|
50
+ | `ibmcloud_cf_orgs` | List organizations |
51
+ | `ibmcloud_cf_spaces` | List spaces |
52
+ | `ibmcloud_cf_apps` | List applications |
53
+ | `ibmcloud_cf_app` | Get app details |
54
+ | `ibmcloud_cf_push` | Deploy application |
55
+ | `ibmcloud_cf_start` | Start application |
56
+ | `ibmcloud_cf_stop` | Stop application |
57
+ | `ibmcloud_cf_restart` | Restart application |
58
+ | `ibmcloud_cf_delete` | Delete application |
59
+ | `ibmcloud_cf_logs` | View app logs |
60
+ | `ibmcloud_cf_env` | Show environment variables |
61
+ | `ibmcloud_cf_set_env` | Set environment variable |
62
+ | `ibmcloud_cf_scale` | Scale application |
63
+ | `ibmcloud_cf_routes` | List routes |
64
+ | `ibmcloud_cf_services` | List services |
65
+ | `ibmcloud_cf_marketplace` | List marketplace |
66
+ | `ibmcloud_cf_create_service` | Create service |
67
+ | `ibmcloud_cf_bind_service` | Bind service to app |
68
+ | `ibmcloud_cf_unbind_service` | Unbind service |
69
+
70
+ ### Kubernetes (15 tools)
71
+ | Tool | Description |
72
+ |------|-------------|
73
+ | `ibmcloud_ks_clusters` | List Kubernetes clusters |
74
+ | `ibmcloud_ks_cluster` | Get cluster details |
75
+ | `ibmcloud_ks_cluster_config` | Configure kubectl |
76
+ | `ibmcloud_ks_cluster_create` | Create cluster |
77
+ | `ibmcloud_ks_cluster_delete` | Delete cluster |
78
+ | `ibmcloud_ks_workers` | List worker nodes |
79
+ | `ibmcloud_ks_worker_pools` | List worker pools |
80
+ | `ibmcloud_ks_worker_pool_create` | Create worker pool |
81
+ | `ibmcloud_ks_worker_pool_resize` | Resize worker pool |
82
+ | `ibmcloud_ks_zones` | List available zones |
83
+ | `ibmcloud_ks_versions` | List K8s versions |
84
+ | `ibmcloud_ks_flavors` | List machine flavors |
85
+
86
+ ### Container Registry (5 tools)
87
+ | Tool | Description |
88
+ |------|-------------|
89
+ | `ibmcloud_cr_namespaces` | List namespaces |
90
+ | `ibmcloud_cr_namespace_add` | Create namespace |
91
+ | `ibmcloud_cr_images` | List images |
92
+ | `ibmcloud_cr_image_rm` | Remove image |
93
+ | `ibmcloud_cr_quota` | Get quota info |
94
+
95
+ ### IAM (18 tools)
96
+ | Tool | Description |
97
+ |------|-------------|
98
+ | `ibmcloud_iam_users` | List users |
99
+ | `ibmcloud_iam_user_invite` | Invite user |
100
+ | `ibmcloud_iam_api_keys` | List API keys |
101
+ | `ibmcloud_iam_api_key_create` | Create API key |
102
+ | `ibmcloud_iam_api_key_delete` | Delete API key |
103
+ | `ibmcloud_iam_service_ids` | List service IDs |
104
+ | `ibmcloud_iam_service_id` | Get service ID |
105
+ | `ibmcloud_iam_service_id_create` | Create service ID |
106
+ | `ibmcloud_iam_service_id_delete` | Delete service ID |
107
+ | `ibmcloud_iam_service_api_keys` | List service API keys |
108
+ | `ibmcloud_iam_service_api_key_create` | Create service API key |
109
+ | `ibmcloud_iam_access_groups` | List access groups |
110
+ | `ibmcloud_iam_access_group` | Get access group |
111
+ | `ibmcloud_iam_access_group_create` | Create access group |
112
+ | `ibmcloud_iam_access_group_users` | List group users |
113
+ | `ibmcloud_iam_access_group_user_add` | Add user to group |
114
+ | `ibmcloud_iam_access_group_policies` | List group policies |
115
+ | `ibmcloud_iam_access_group_policy_create` | Create policy |
116
+ | `ibmcloud_iam_roles` | List IAM roles |
117
+
118
+ ### Catalog & Billing (7 tools)
119
+ | Tool | Description |
120
+ |------|-------------|
121
+ | `ibmcloud_catalog_search` | Search service catalog |
122
+ | `ibmcloud_catalog_service` | Get service details |
123
+ | `ibmcloud_catalog_service_plans` | List service plans |
124
+ | `ibmcloud_billing_account_usage` | Get account usage |
125
+ | `ibmcloud_billing_resource_group_usage` | Get RG usage |
126
+ | `ibmcloud_billing_resource_instances_usage` | Get instance usage |
127
+ | `ibmcloud_billing_org_usage` | Get org usage |
128
+
129
+ ### Plugins (4 tools)
130
+ | Tool | Description |
131
+ |------|-------------|
132
+ | `ibmcloud_plugin_list` | List installed plugins |
133
+ | `ibmcloud_plugin_repo_plugins` | List available plugins |
134
+ | `ibmcloud_plugin_install` | Install a plugin |
135
+ | `ibmcloud_version` | Show CLI version |
136
+
137
+ ## Setup
138
+
139
+ ### 1. Prerequisites
140
+
141
+ Install IBM Cloud CLI:
142
+ ```bash
143
+ curl -fsSL https://clis.cloud.ibm.com/install/osx | sh
144
+ ```
145
+
146
+ ### 2. Install Dependencies
147
+
148
+ ```bash
149
+ cd ~/mcp-servers/ibmcloud-mcp
150
+ npm install
151
+ npm run build
152
+ ```
153
+
154
+ ### 3. Add to Claude Code
155
+
156
+ Add to `~/.claude.json`:
157
+
158
+ ```json
159
+ {
160
+ "mcpServers": {
161
+ "ibmcloud": {
162
+ "type": "stdio",
163
+ "command": "node",
164
+ "args": ["/Users/matthewkarsten/mcp-servers/ibmcloud-mcp/dist/index.js"]
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ ## Architecture
171
+
172
+ ```
173
+ Claude Code (Opus 4.5)
174
+
175
+ └──▶ IBM Cloud MCP Server
176
+
177
+ └──▶ ibmcloud CLI
178
+
179
+ ├── Resource Controller
180
+ ├── Cloud Foundry API
181
+ ├── Kubernetes Service
182
+ ├── Container Registry
183
+ ├── IAM Service
184
+ └── Billing Service
185
+ ```
186
+
187
+ ## Usage Examples
188
+
189
+ ```
190
+ User: List my IBM Cloud Kubernetes clusters
191
+
192
+ Claude: [Uses ibmcloud_ks_clusters tool]
193
+ Result:
194
+ - mycluster (VPC Gen2, us-south, 1.28, 3 workers) - normal
195
+ - dev-cluster (Classic, dal10, 1.27, 2 workers) - normal
196
+
197
+ User: Create a new Cloud Object Storage instance
198
+
199
+ Claude: [Uses ibmcloud_resource_service_instance_create]
200
+ Created: my-cos-instance (cloud-object-storage, lite plan)
201
+ ```
202
+
203
+ ## IBM Cloud Services Supported
204
+
205
+ - **Watson AI**: watsonx.ai, Watson Studio, Watson ML
206
+ - **Storage**: Cloud Object Storage, Block Storage
207
+ - **Databases**: Db2, PostgreSQL, MongoDB, Redis
208
+ - **Containers**: Kubernetes, OpenShift, Container Registry
209
+ - **Serverless**: Cloud Functions, Code Engine
210
+ - **Networking**: VPC, Load Balancers, DNS
211
+ - **Security**: Key Protect, Secrets Manager, IAM
212
+ - **Integration**: API Connect, MQ, Event Streams
213
+
214
+ ## Files
215
+
216
+ ```
217
+ ibmcloud-mcp/
218
+ ├── src/
219
+ │ ├── index.ts # MCP server implementation
220
+ │ └── cli.ts # IBM Cloud CLI wrapper
221
+ ├── dist/ # Compiled JavaScript
222
+ ├── package.json
223
+ ├── tsconfig.json
224
+ └── README.md
225
+ ```
226
+
227
+ ## Author
228
+
229
+ Matthew Karsten
230
+
231
+ ## License
232
+
233
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export interface CLIResult {
2
+ success: boolean;
3
+ stdout: string;
4
+ stderr: string;
5
+ exitCode: number;
6
+ }
7
+ export declare function executeIBMCloud(args: string[], options?: {
8
+ timeout?: number;
9
+ env?: Record<string, string>;
10
+ }): Promise<CLIResult>;
11
+ export declare function formatResult(result: CLIResult): string;
12
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B,GACA,OAAO,CAAC,SAAS,CAAC,CAqEpB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAgBtD"}
package/dist/cli.js ADDED
@@ -0,0 +1,80 @@
1
+ import { spawn } from "child_process";
2
+ export async function executeIBMCloud(args, options) {
3
+ return new Promise((resolve) => {
4
+ const timeout = options?.timeout ?? 120000; // 2 minute default
5
+ const env = { ...process.env, ...options?.env };
6
+ // Add --output json flag if not already present and command supports it
7
+ const jsonCommands = [
8
+ "account",
9
+ "resource",
10
+ "iam",
11
+ "catalog",
12
+ "target",
13
+ "regions",
14
+ "api",
15
+ ];
16
+ const shouldAddJson = args.length > 0 &&
17
+ jsonCommands.some((cmd) => args[0] === cmd) &&
18
+ !args.includes("--output") &&
19
+ !args.includes("-o");
20
+ const finalArgs = shouldAddJson ? [...args, "--output", "json"] : args;
21
+ const child = spawn("ibmcloud", finalArgs, {
22
+ env,
23
+ shell: true,
24
+ });
25
+ let stdout = "";
26
+ let stderr = "";
27
+ child.stdout.on("data", (data) => {
28
+ stdout += data.toString();
29
+ });
30
+ child.stderr.on("data", (data) => {
31
+ stderr += data.toString();
32
+ });
33
+ const timer = setTimeout(() => {
34
+ child.kill("SIGTERM");
35
+ resolve({
36
+ success: false,
37
+ stdout,
38
+ stderr: stderr + "\nCommand timed out",
39
+ exitCode: -1,
40
+ });
41
+ }, timeout);
42
+ child.on("close", (code) => {
43
+ clearTimeout(timer);
44
+ resolve({
45
+ success: code === 0,
46
+ stdout: stdout.trim(),
47
+ stderr: stderr.trim(),
48
+ exitCode: code ?? -1,
49
+ });
50
+ });
51
+ child.on("error", (err) => {
52
+ clearTimeout(timer);
53
+ resolve({
54
+ success: false,
55
+ stdout: "",
56
+ stderr: err.message,
57
+ exitCode: -1,
58
+ });
59
+ });
60
+ });
61
+ }
62
+ export function formatResult(result) {
63
+ if (result.success) {
64
+ return result.stdout || "Command completed successfully";
65
+ }
66
+ else {
67
+ let output = "";
68
+ if (result.stdout) {
69
+ output += result.stdout + "\n";
70
+ }
71
+ if (result.stderr) {
72
+ output += `Error: ${result.stderr}`;
73
+ }
74
+ if (!output) {
75
+ output = `Command failed with exit code ${result.exitCode}`;
76
+ }
77
+ return output;
78
+ }
79
+ }
80
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAStC,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAc,EACd,OAGC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,mBAAmB;QAC/D,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC;QAEhD,wEAAwE;QACxE,MAAM,YAAY,GAAG;YACnB,SAAS;YACT,UAAU;YACV,KAAK;YACL,SAAS;YACT,QAAQ;YACR,SAAS;YACT,KAAK;SACN,CAAC;QACF,MAAM,aAAa,GACjB,IAAI,CAAC,MAAM,GAAG,CAAC;YACf,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;YAC3C,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC1B,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEvB,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEvE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE;YACzC,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AAO;gBACnB,QAAQ,EAAE,CAAC,CAAC;aACb,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,MAAM,IAAI,gCAAgC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;QACjC,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,iCAAiC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}