@futuretea/rancher-mcp-server 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +220 -258
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -4,38 +4,31 @@
4
4
  [![npm](https://img.shields.io/npm/v/@futuretea/rancher-mcp-server)](https://www.npmjs.com/package/@futuretea/rancher-mcp-server)
5
5
  [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/futuretea/rancher-mcp-server?sort=semver)](https://github.com/futuretea/rancher-mcp-server/releases/latest)
6
6
 
7
- [Features](#features) | [🚀 Getting Started](#getting-started) | [⚙️ Configuration](#configuration) | [🛠️ Tools](#tools-and-functionalities) | [🧑‍💻 Development](#development)
8
-
9
- ## Features <a id="features"></a>
10
-
11
- A powerful and flexible [Model Context Protocol (MCP)](https://blog.marcnuri.com/model-context-protocol-mcp-introduction) server implementation with support for **Rancher multi-cluster management**.
12
-
13
- - **✅ Multi-cluster Management**: Access and manage multiple Kubernetes clusters through Rancher API
14
- - **✅ Core Kubernetes Resources**: Perform operations on Kubernetes resources across multiple clusters
15
- - **List** clusters, nodes, workloads, namespaces, services, configmaps, and secrets
16
- - **Get** kubeconfig for any cluster
17
- - **Intelligent Diagnostic Chain**: Perform health checks with Service → Pods and Ingress → Service → Pods diagnostic chains
18
- - **Ready/Degraded Dual-State Diagnosis**: Identify both critical failures and performance degradation
19
- - **✅ Rancher-specific Resources**: Access Rancher-specific resources
20
- - **List** Rancher projects and users
21
- - **Check** cluster health status
22
- - **View** project access permissions
23
- - **✅ Security Configuration**: Support for read-only mode and disabling destructive operations
24
- - **Secrets Protection**: Secret data is never exposed, only metadata
25
- - **✅ Multiple Output Formats**: Support for table, YAML, and JSON output formats
26
- - **✅ Performance Optimized**: Intelligent API call caching reduces API calls by up to 93% during bulk operations
27
- - **✅ Cross-platform Support**: Available as native binaries for Linux, macOS, and Windows, as well as an npm package
28
-
29
- Unlike other Kubernetes MCP server implementations, this server is **specifically designed for Rancher multi-cluster environments** and provides seamless access to multiple clusters through a single interface.
30
-
31
- - **✅ Lightweight**: The server is distributed as a single native binary for Linux, macOS, and Windows
32
- - **✅ High-Performance / Low-Latency**: Directly interacts with Rancher API server without the overhead of calling external commands
33
- - **✅ Efficient Bulk Operations**: Optimized API calls with intelligent caching for diagnosing multiple resources
34
- - **✅ Self-Documenting**: Detailed tool descriptions help LLMs understand capabilities and select the right tools
35
- - **✅ Configurable**: Supports [command-line arguments](#configuration) to configure the server behavior
36
- - **✅ Well tested**: The server has an extensive test suite to ensure its reliability and correctness
37
-
38
- ## 🚀 Getting Started <a id="getting-started"></a>
7
+ [Features](#features) | [Getting Started](#getting-started) | [Configuration](#configuration) | [Tools](#tools-and-functionalities) | [Development](#development)
8
+
9
+ ## Features <a id="features"></a>
10
+
11
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for Rancher multi-cluster management.
12
+
13
+ - **Multi-cluster Management**: Access multiple Kubernetes clusters through Rancher API
14
+ - **Kubernetes Resources via Steve API**: CRUD operations on any resource type
15
+ - Get/List any resource (Pod, Deployment, Service, ConfigMap, Secret, CRD, etc.)
16
+ - Create resources from JSON manifests
17
+ - Patch resources using JSON Patch (RFC 6902)
18
+ - Delete resources
19
+ - Query container logs with filtering (tail lines, time range, timestamps)
20
+ - Inspect pods with parent workload, metrics, and logs
21
+ - **Rancher Resources via Norman API**: List clusters and projects
22
+ - **Security Controls**:
23
+ - `read_only`: Disables create, patch, and delete operations
24
+ - `disable_destructive`: Disables delete operations only
25
+ - Secret data is never exposed, only metadata
26
+ - **Output Formats**: Table, YAML, and JSON
27
+ - **Output Filters**: Remove verbose fields like `managedFields` from responses
28
+ - **Pagination**: Limit and page parameters for list operations
29
+ - **Cross-platform**: Native binaries for Linux, macOS, Windows, and npm package
30
+
31
+ ## Getting Started <a id="getting-started"></a>
39
32
 
40
33
  ### Requirements
41
34
 
@@ -44,11 +37,7 @@ Unlike other Kubernetes MCP server implementations, this server is **specificall
44
37
 
45
38
  ### Claude Desktop
46
39
 
47
- #### Using npx
48
-
49
- If you have npm installed, this is the fastest way to get started with `@futuretea/rancher-mcp-server` on Claude Desktop.
50
-
51
- Open your `claude_desktop_config.json` and add the mcp server to the list of `mcpServers`:
40
+ Using npx:
52
41
 
53
42
  ```json
54
43
  {
@@ -70,8 +59,6 @@ Open your `claude_desktop_config.json` and add the mcp server to the list of `mc
70
59
 
71
60
  ### VS Code / VS Code Insiders
72
61
 
73
- Install the Rancher MCP server extension in VS Code by running the following command:
74
-
75
62
  ```shell
76
63
  # For VS Code
77
64
  code --add-mcp '{"name":"rancher","command":"npx","args":["@futuretea/rancher-mcp-server@latest","--rancher-server-url","https://your-rancher-server.com","--rancher-token","your-token"]}'
@@ -82,7 +69,7 @@ code-insiders --add-mcp '{"name":"rancher","command":"npx","args":["@futuretea/r
82
69
 
83
70
  ### Cursor
84
71
 
85
- Install the Rancher MCP server extension in Cursor by editing the `mcp.json` file:
72
+ Edit `mcp.json`:
86
73
 
87
74
  ```json
88
75
  {
@@ -102,94 +89,103 @@ Install the Rancher MCP server extension in Cursor by editing the `mcp.json` fil
102
89
  }
103
90
  ```
104
91
 
105
- ## ⚙️ Configuration <a id="configuration"></a>
92
+ ## Configuration <a id="configuration"></a>
106
93
 
107
- The Rancher MCP server can be configured using command line (CLI) arguments or a configuration file.
94
+ Configuration can be set via CLI flags, environment variables, or a config file.
108
95
 
109
- You can run the CLI executable either by using `npx` or by downloading the [latest release binary](https://github.com/futuretea/rancher-mcp-server/releases/latest).
96
+ **Priority (highest to lowest):**
97
+ 1. Command-line flags
98
+ 2. Environment variables (prefix: `RANCHER_MCP_`)
99
+ 3. Configuration file
100
+ 4. Default values
110
101
 
111
- ```shell
112
- # Run the Rancher MCP server using npx (in case you have npm and node installed)
113
- npx @futuretea/rancher-mcp-server@latest --help
114
- ```
102
+ ### CLI Options
115
103
 
116
104
  ```shell
117
- # Run the Rancher MCP server using the latest release binary
118
- ./rancher-mcp-server --help
105
+ npx @futuretea/rancher-mcp-server@latest --help
119
106
  ```
120
107
 
121
- ### Configuration Options
122
-
123
- | Option | Description |
124
- |--------|-------------|
125
- | `--port` | Starts the MCP server in HTTP/SSE mode and listens on the specified port. Use 0 for stdio mode (default for MCP clients) |
126
- | `--sse-base-url` | SSE public base URL to use when sending the endpoint message (e.g. https://example.com) |
127
- | `--log-level` | Sets the logging level (values from 0-9) |
128
- | `--rancher-server-url` | URL of the Rancher server |
129
- | `--rancher-token` | Bearer token for Rancher API authentication |
130
- | `--rancher-access-key` | Access key for Rancher API authentication |
131
- | `--rancher-secret-key` | Secret key for Rancher API authentication |
132
- | `--rancher-tls-insecure` | Skip TLS certificate verification for Rancher server (default: false) |
133
- | `--list-output` | Output format for resource list operations (one of: table, yaml, json) (default "table") |
134
- | `--read-only` | If set, the MCP server will run in read-only mode, meaning it will not allow any write operations on the Rancher cluster |
135
- | `--disable-destructive` | If set, the MCP server will disable all destructive operations on the Rancher cluster |
136
- | `--toolsets` | Comma-separated list of toolsets to enable. Default: [config,core,rancher,networking] |
137
- | `--enabled-tools` | Comma-separated list of tools to enable (overrides toolsets) |
138
- | `--disabled-tools` | Comma-separated list of tools to disable (overrides toolsets) |
108
+ | Option | Description | Default |
109
+ |--------|-------------|---------|
110
+ | `--config` | Config file path (YAML) | |
111
+ | `--port` | Port for HTTP/SSE mode (0 = stdio mode) | `0` |
112
+ | `--sse-base-url` | Public base URL for SSE endpoint | |
113
+ | `--log-level` | Log level (0-9) | `0` |
114
+ | `--rancher-server-url` | Rancher server URL | |
115
+ | `--rancher-token` | Rancher bearer token | |
116
+ | `--rancher-access-key` | Rancher access key | |
117
+ | `--rancher-secret-key` | Rancher secret key | |
118
+ | `--rancher-tls-insecure` | Skip TLS verification | `false` |
119
+ | `--read-only` | Disable write operations | `true` |
120
+ | `--disable-destructive` | Disable delete operations | `false` |
121
+ | `--list-output` | Output format (json, table, yaml) | `json` |
122
+ | `--output-filters` | Fields to remove from output | `metadata.managedFields` |
123
+ | `--toolsets` | Toolsets to enable | `kubernetes,rancher` |
124
+ | `--enabled-tools` | Specific tools to enable | |
125
+ | `--disabled-tools` | Specific tools to disable | |
139
126
 
140
127
  ### Configuration File
141
128
 
142
- Create a configuration file `config.yaml`:
129
+ Create `config.yaml`:
143
130
 
144
131
  ```yaml
145
- port: 0 # 0 for stdio mode, set to a port number (e.g., 8080) for HTTP/SSE mode
146
- log_level: 0
132
+ port: 0 # 0 for stdio, or set a port like 8080 for HTTP/SSE
147
133
 
148
- # SSE (Server-Sent Events) configuration (optional, for HTTP/SSE mode)
149
- # sse_base_url: https://your-domain.com:8080
134
+ log_level: 0
150
135
 
151
136
  rancher_server_url: https://your-rancher-server.com
152
137
  rancher_token: your-bearer-token
153
138
  # Or use Access Key/Secret Key:
154
139
  # rancher_access_key: your-access-key
155
140
  # rancher_secret_key: your-secret-key
156
- list_output: table
157
- read_only: false
141
+ # rancher_tls_insecure: false
142
+
143
+ read_only: true # default: true
158
144
  disable_destructive: false
145
+
146
+ list_output: json
147
+
148
+ # Remove verbose fields from output
149
+ output_filters:
150
+ - metadata.managedFields
151
+ - metadata.annotations.kubectl.kubernetes.io/last-applied-configuration
152
+
159
153
  toolsets:
160
- - config
161
- - core
154
+ - kubernetes
162
155
  - rancher
163
- - networking # Optional: enable network resource management
156
+
157
+ # enabled_tools: []
158
+ # disabled_tools: []
164
159
  ```
165
160
 
166
- ### HTTP/SSE Mode
161
+ ### Environment Variables
167
162
 
168
- The Rancher MCP server supports running in HTTP/SSE (Server-Sent Events) mode for network-based access. This is useful when you want to:
163
+ Use `RANCHER_MCP_` prefix with underscores:
169
164
 
170
- - Access the server from remote clients
171
- - Use the server in a containerized environment
172
- - Enable multiple clients to connect to the same server instance
165
+ ```shell
166
+ RANCHER_MCP_PORT=8080
167
+ RANCHER_MCP_RANCHER_SERVER_URL=https://rancher.example.com
168
+ RANCHER_MCP_RANCHER_TOKEN=your-token
169
+ RANCHER_MCP_READ_ONLY=true
170
+ ```
173
171
 
174
- #### Running in HTTP/SSE Mode
172
+ ### HTTP/SSE Mode
173
+
174
+ Run with a port number for network access:
175
175
 
176
176
  ```shell
177
- # Start the server on port 8080
178
177
  rancher-mcp-server --port 8080 \
179
178
  --rancher-server-url https://your-rancher-server.com \
180
179
  --rancher-token your-token
181
180
  ```
182
181
 
183
- The server will expose the following endpoints:
184
-
185
- - **`/healthz`** - Health check endpoint (returns 200 OK)
186
- - **`/mcp`** - Streamable HTTP endpoint for MCP protocol
187
- - **`/sse`** - Server-Sent Events endpoint for real-time communication
188
- - **`/message`** - Message endpoint for SSE clients
189
-
190
- #### Using SSE Base URL
182
+ Endpoints:
183
+ - `/healthz` - Health check
184
+ - `/mcp` - Streamable HTTP endpoint
185
+ - `/sse` - Server-Sent Events endpoint
186
+ - `/message` - Message endpoint for SSE clients
191
187
 
192
- When deploying behind a reverse proxy or load balancer, you can specify a public base URL:
188
+ With a public URL behind a proxy:
193
189
 
194
190
  ```shell
195
191
  rancher-mcp-server --port 8080 \
@@ -198,214 +194,180 @@ rancher-mcp-server --port 8080 \
198
194
  --rancher-token your-token
199
195
  ```
200
196
 
201
- ## 🛠️ Tools and Functionalities <a id="tools-and-functionalities"></a>
197
+ ## Tools and Functionalities <a id="tools-and-functionalities"></a>
198
+
199
+ Tools are organized into toolsets. Use `--toolsets` to enable specific sets or `--enabled-tools`/`--disabled-tools` for fine-grained control.
200
+
201
+ ### Toolsets
202
+
203
+ | Toolset | API | Description |
204
+ |---------|-----|-------------|
205
+ | kubernetes | Steve | Kubernetes CRUD operations for any resource type |
206
+ | rancher | Norman | Cluster and project listing |
207
+
208
+ ### kubernetes
209
+
210
+ <details>
211
+ <summary>kubernetes_get</summary>
212
+
213
+ Get a Kubernetes resource by kind, namespace, and name.
202
214
 
203
- The Rancher MCP server supports enabling or disabling specific groups of tools and functionalities (toolsets) via the `--toolsets` command-line flag or `toolsets` configuration option.
204
- This allows you to control which Rancher functionalities are available to your AI tools.
205
- Enabling only the toolsets you need can help reduce the context size and improve the LLM's tool selection accuracy.
215
+ | Parameter | Type | Required | Description |
216
+ |-----------|------|----------|-------------|
217
+ | `cluster` | string | Yes | Cluster ID |
218
+ | `kind` | string | Yes | Resource kind (e.g., pod, deployment, service) |
219
+ | `namespace` | string | No | Namespace (optional for cluster-scoped resources) |
220
+ | `name` | string | Yes | Resource name |
221
+ | `format` | string | No | Output format: json, yaml (default: json) |
206
222
 
207
- ### Available Toolsets
223
+ </details>
224
+
225
+ <details>
226
+ <summary>kubernetes_list</summary>
208
227
 
209
- The following sets of tools are available (all on by default):
228
+ List Kubernetes resources by kind.
210
229
 
211
- | Toolset | Description |
212
- |---------|-------------|
213
- | config | Tools for managing cluster configuration (kubeconfig) |
214
- | core | Core Kubernetes resource management tools (nodes, workloads, namespaces, configmaps, secrets, services) |
215
- | rancher | Rancher-specific tools (clusters, projects, users, cluster health, access control) |
216
- | networking | Network resource management tools (ingresses) |
230
+ | Parameter | Type | Required | Description |
231
+ |-----------|------|----------|-------------|
232
+ | `cluster` | string | Yes | Cluster ID |
233
+ | `kind` | string | Yes | Resource kind |
234
+ | `namespace` | string | No | Namespace (empty = all namespaces) |
235
+ | `name` | string | No | Filter by name (partial match) |
236
+ | `labelSelector` | string | No | Label selector (e.g., "app=nginx,env=prod") |
237
+ | `limit` | integer | No | Items per page (default: 100) |
238
+ | `page` | integer | No | Page number, starting from 1 (default: 1) |
239
+ | `format` | string | No | Output format: json, table, yaml (default: json) |
217
240
 
218
- ### Tools
241
+ </details>
219
242
 
220
243
  <details>
221
- <summary>config</summary>
244
+ <summary>kubernetes_logs</summary>
222
245
 
223
- - **configuration_view** - Generate and view Kubernetes configuration (kubeconfig) for a Rancher cluster
224
- - `cluster` (`string`) - Cluster ID to generate kubeconfig for
246
+ Get logs from a pod container.
247
+
248
+ | Parameter | Type | Required | Description |
249
+ |-----------|------|----------|-------------|
250
+ | `cluster` | string | Yes | Cluster ID |
251
+ | `namespace` | string | Yes | Namespace |
252
+ | `name` | string | Yes | Pod name |
253
+ | `container` | string | No | Container name (empty = all containers) |
254
+ | `tailLines` | integer | No | Lines from end (default: 100) |
255
+ | `sinceSeconds` | integer | No | Logs from last N seconds |
256
+ | `timestamps` | boolean | No | Include timestamps (default: false) |
257
+ | `previous` | boolean | No | Previous container instance (default: false) |
225
258
 
226
259
  </details>
227
260
 
228
261
  <details>
229
- <summary>core</summary>
230
-
231
- - **cluster_list** - List all available Kubernetes clusters
232
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
233
-
234
- - **node_get** - Get a single node by ID, more efficient than list
235
- - `cluster` (`string`) **(required)** - Cluster ID
236
- - `node` (`string`) **(required)** - Node ID to get
237
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
238
-
239
- - **node_list** - List all nodes in a cluster
240
- - `cluster` (`string`) - Cluster ID to list nodes from (optional)
241
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
242
-
243
- - **workload_get** - Get a single workload by name and namespace, more efficient than list
244
- - `cluster` (`string`) **(required)** - Cluster ID
245
- - `namespace` (`string`) **(required)** - Namespace name
246
- - `name` (`string`) **(required)** - Workload name to get
247
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
248
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
249
-
250
- - **workload_list** - List workloads (deployments, statefulsets, daemonsets, jobs) and orphan pods in a cluster
251
- - `cluster` (`string`) **(required)** - Cluster ID
252
- - `project` (`string`) - Project ID to filter workloads (optional)
253
- - `namespace` (`string`) - Namespace name to filter workloads (optional)
254
- - `node` (`string`) - Node name to filter workloads (optional)
255
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
256
-
257
- - **namespace_get** - Get a single namespace by name, more efficient than list
258
- - `cluster` (`string`) **(required)** - Cluster ID
259
- - `name` (`string`) **(required)** - Namespace name to get
260
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
261
-
262
- - **namespace_list** - List namespaces in a cluster
263
- - `cluster` (`string`) **(required)** - Cluster ID
264
- - `project` (`string`) - Project ID to filter namespaces (optional)
265
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
266
-
267
- - **configmap_get** - Get a single ConfigMap by name and namespace, more efficient than list
268
- - `cluster` (`string`) **(required)** - Cluster ID
269
- - `namespace` (`string`) **(required)** - Namespace name
270
- - `name` (`string`) **(required)** - ConfigMap name to get
271
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
272
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
273
-
274
- - **configmap_get** - Get a single ConfigMap by name and namespace, more efficient than list
275
- - `cluster` (`string`) **(required)** - Cluster ID
276
- - `namespace` (`string`) **(required)** - Namespace name
277
- - `name` (`string`) **(required)** - ConfigMap name to get
278
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
279
- - `format` (`string`) - Output format: yaml or json (default: "json")
280
-
281
- - **configmap_list** - List all ConfigMaps in a cluster
282
- - `cluster` (`string`) **(required)** - Cluster ID
283
- - `project` (`string`) - Project ID to filter ConfigMaps (optional)
284
- - `namespace` (`string`) - Namespace name to filter ConfigMaps (optional)
285
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
286
-
287
- - **secret_get** - Get a single Secret by name and namespace, more efficient than list (metadata only, does not expose secret data)
288
- - `cluster` (`string`) **(required)** - Cluster ID
289
- - `namespace` (`string`) **(required)** - Namespace name
290
- - `name` (`string`) **(required)** - Secret name to get
291
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
292
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
293
-
294
- - **secret_get** - Get a single Secret by name and namespace, more efficient than list (metadata only, does not expose secret data)
295
- - `cluster` (`string`) **(required)** - Cluster ID
296
- - `namespace` (`string`) **(required)** - Namespace name
297
- - `name` (`string`) **(required)** - Secret name to get
298
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
299
- - `format` (`string`) - Output format: yaml or json (default: "json")
300
-
301
- - **secret_list** - List all Secrets in a cluster (metadata only, does not expose secret data)
302
- - `cluster` (`string`) **(required)** - Cluster ID
303
- - `project` (`string`) - Project ID to filter secrets (optional)
304
- - `namespace` (`string`) - Namespace name to filter secrets (optional)
305
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
306
-
307
- - **service_get** - Get a single service by name with optional pod diagnostic check (Service → Pods), more efficient than list
308
- - `cluster` (`string`) **(required)** - Cluster ID
309
- - `namespace` (`string`) **(required)** - Namespace name
310
- - `name` (`string`) **(required)** - Service name to get
311
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
312
- - `getPodDetails` (`boolean`) - Get detailed pod information and perform health checks (default: false)
313
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
314
-
315
- - **service_list** - List services with optional pod diagnostic check (Service → Pods), supports Ready/Degraded dual-state diagnosis
316
- - `cluster` (`string`) **(required)** - Cluster ID
317
- - `project` (`string`) - Project ID to filter services (optional)
318
- - `namespace` (`string`) - Namespace name to filter services (optional)
319
- - `getPodDetails` (`boolean`) - Get pod information and perform health checks for services (default: false)
320
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
262
+ <summary>kubernetes_inspect_pod</summary>
263
+
264
+ Get pod diagnostics: details, parent workload, metrics, and logs.
265
+
266
+ | Parameter | Type | Required | Description |
267
+ |-----------|------|----------|-------------|
268
+ | `cluster` | string | Yes | Cluster ID |
269
+ | `namespace` | string | Yes | Namespace |
270
+ | `name` | string | Yes | Pod name |
321
271
 
322
272
  </details>
323
273
 
324
274
  <details>
325
- <summary>rancher</summary>
275
+ <summary>kubernetes_create</summary>
326
276
 
327
- - **cluster_list** - List all available Kubernetes clusters
328
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
277
+ Create a Kubernetes resource. Disabled when `read_only=true`.
329
278
 
330
- - **project_get** - Get a single Rancher project by ID, more efficient than list
331
- - `project` (`string`) **(required)** - Project ID to get
332
- - `cluster` (`string`) **(required)** - Cluster ID (required for verification)
333
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
279
+ | Parameter | Type | Required | Description |
280
+ |-----------|------|----------|-------------|
281
+ | `cluster` | string | Yes | Cluster ID |
282
+ | `resource` | string | Yes | JSON manifest (must include apiVersion, kind, metadata, spec) |
334
283
 
335
- - **project_list** - List Rancher projects across clusters
336
- - `cluster` (`string`) - Filter projects by cluster ID (optional)
337
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
284
+ </details>
285
+
286
+ <details>
287
+ <summary>kubernetes_patch</summary>
288
+
289
+ Patch a resource using JSON Patch (RFC 6902). Disabled when `read_only=true`.
338
290
 
339
- - **user_get** - Get a single Rancher user by ID, more efficient than list
340
- - `user` (`string`) **(required)** - User ID to get
341
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
291
+ | Parameter | Type | Required | Description |
292
+ |-----------|------|----------|-------------|
293
+ | `cluster` | string | Yes | Cluster ID |
294
+ | `kind` | string | Yes | Resource kind |
295
+ | `namespace` | string | No | Namespace (optional for cluster-scoped) |
296
+ | `name` | string | Yes | Resource name |
297
+ | `patch` | string | Yes | JSON Patch array, e.g., `[{"op":"replace","path":"/spec/replicas","value":3}]` |
342
298
 
343
- - **user_list** - List all Rancher users
344
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
299
+ </details>
300
+
301
+ <details>
302
+ <summary>kubernetes_delete</summary>
345
303
 
346
- - **cluster_health** - Get health status of Rancher clusters
347
- - `cluster` (`string`) - Specific cluster ID to check health (optional)
348
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
304
+ Delete a Kubernetes resource. Disabled when `read_only=true` or `disable_destructive=true`.
349
305
 
350
- - **project_access** - List user access permissions for Rancher projects
351
- - `project` (`string`) - Project ID to check access (optional)
352
- - `cluster` (`string`) - Cluster ID (optional)
353
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
306
+ | Parameter | Type | Required | Description |
307
+ |-----------|------|----------|-------------|
308
+ | `cluster` | string | Yes | Cluster ID |
309
+ | `kind` | string | Yes | Resource kind |
310
+ | `namespace` | string | No | Namespace (optional for cluster-scoped) |
311
+ | `name` | string | Yes | Resource name |
354
312
 
355
313
  </details>
356
314
 
315
+ ### rancher
316
+
357
317
  <details>
358
- <summary>networking</summary>
359
-
360
- - **ingress_get** - Get a single ingress by name with diagnostic chain check (Ingress → Service → Pods), more efficient than list
361
- - `cluster` (`string`) **(required)** - Cluster ID
362
- - `namespace` (`string`) **(required)** - Namespace name
363
- - `name` (`string`) **(required)** - Ingress name to get
364
- - `project` (`string`) - Project ID (optional, will auto-detect if not provided)
365
- - `getPodDetails` (`boolean`) - Get detailed pod information and perform health checks (default: false)
366
- - `format` (`string`) - Output format: yaml or json (default: "yaml")
367
-
368
- - **ingress_list** - List ingresses with full diagnostic chain check (Ingress → Service → Pods), supports Ready/Degraded dual-state diagnosis
369
- - `cluster` (`string`) **(required)** - Cluster ID
370
- - `project` (`string`) - Project ID to filter ingresses (optional)
371
- - `namespace` (`string`) - Namespace name to filter ingresses (optional)
372
- - `getPodDetails` (`boolean`) - Get detailed pod information and perform health checks (default: false)
373
- - `format` (`string`) - Output format: table, yaml, or json (default: "table")
318
+ <summary>cluster_list</summary>
319
+
320
+ List available Rancher clusters.
321
+
322
+ | Parameter | Type | Required | Description |
323
+ |-----------|------|----------|-------------|
324
+ | `name` | string | No | Filter by cluster name (partial match) |
325
+ | `limit` | integer | No | Items per page (default: 100) |
326
+ | `page` | integer | No | Page number (default: 1) |
327
+ | `format` | string | No | Output format: json, table, yaml (default: json) |
374
328
 
375
329
  </details>
376
330
 
377
- ## 🧑‍💻 Development <a id="development"></a>
331
+ <details>
332
+ <summary>project_list</summary>
333
+
334
+ List Rancher projects.
335
+
336
+ | Parameter | Type | Required | Description |
337
+ |-----------|------|----------|-------------|
338
+ | `cluster` | string | No | Filter by cluster ID |
339
+ | `name` | string | No | Filter by project name (partial match) |
340
+ | `limit` | integer | No | Items per page (default: 100) |
341
+ | `page` | integer | No | Page number (default: 1) |
342
+ | `format` | string | No | Output format: json, table, yaml (default: json) |
343
+
344
+ </details>
378
345
 
379
- ### Running with mcp-inspector
346
+ ## Development <a id="development"></a>
380
347
 
381
- Compile the project and run the Rancher MCP server with [mcp-inspector](https://modelcontextprotocol.io/docs/tools/inspector) to inspect the MCP server.
348
+ ### Build
382
349
 
383
350
  ```shell
384
- # Compile the project
385
351
  make build
386
- # Run the Rancher MCP server with mcp-inspector
387
- npx @modelcontextprotocol/inspector@latest $(pwd)/rancher-mcp-server
388
352
  ```
389
353
 
390
- For more development information, see [DEVELOPMENT.md](DEVELOPMENT.md).
354
+ ### Run with mcp-inspector
391
355
 
392
- ## Contributing
356
+ ```shell
357
+ npx @modelcontextprotocol/inspector@latest $(pwd)/rancher-mcp-server
358
+ ```
393
359
 
394
- We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on how to submit issues, feature requests, and pull requests.
360
+ See [DEVELOPMENT.md](DEVELOPMENT.md) for more details.
395
361
 
396
- ### Development
362
+ ## Contributing
397
363
 
398
- For development setup and guidelines, see [DEVELOPMENT.md](DEVELOPMENT.md).
364
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
399
365
 
400
366
  ## Support
401
367
 
402
- If you encounter issues:
403
- - Create a [GitHub Issue](https://github.com/futuretea/rancher-mcp-server/issues)
404
- - Check the [troubleshooting guide](TROUBLESHOOTING.md)
405
- - Review the [documentation](https://github.com/futuretea/rancher-mcp-server/docs)
368
+ - [GitHub Issues](https://github.com/futuretea/rancher-mcp-server/issues)
369
+ - [Troubleshooting Guide](TROUBLESHOOTING.md)
406
370
 
407
- ## Community
371
+ ## License
408
372
 
409
- - **GitHub**: [futuretea/rancher-mcp-server](https://github.com/futuretea/rancher-mcp-server)
410
- - **Issues**: [GitHub Issues](https://github.com/futuretea/rancher-mcp-server/issues)
411
- - **Discussions**: [GitHub Discussions](https://github.com/futuretea/rancher-mcp-server/discussions)
373
+ [Apache-2.0](LICENSE)
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@futuretea/rancher-mcp-server",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Model Context Protocol (MCP) server for Rancher multi-cluster management",
5
5
  "main": "./bin/index.js",
6
6
  "bin": {
7
7
  "rancher-mcp-server": "bin/index.js"
8
8
  },
9
9
  "optionalDependencies": {
10
- "@futuretea/rancher-mcp-server-darwin-amd64": "0.3.2",
11
- "@futuretea/rancher-mcp-server-darwin-arm64": "0.3.2",
12
- "@futuretea/rancher-mcp-server-linux-amd64": "0.3.2",
13
- "@futuretea/rancher-mcp-server-linux-arm64": "0.3.2",
14
- "@futuretea/rancher-mcp-server-windows-amd64": "0.3.2",
15
- "@futuretea/rancher-mcp-server-windows-arm64": "0.3.2"
10
+ "@futuretea/rancher-mcp-server-darwin-amd64": "0.4.0",
11
+ "@futuretea/rancher-mcp-server-darwin-arm64": "0.4.0",
12
+ "@futuretea/rancher-mcp-server-linux-amd64": "0.4.0",
13
+ "@futuretea/rancher-mcp-server-linux-arm64": "0.4.0",
14
+ "@futuretea/rancher-mcp-server-windows-amd64": "0.4.0",
15
+ "@futuretea/rancher-mcp-server-windows-arm64": "0.4.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",