Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 0 additions & 187 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,190 +498,3 @@ FROM golang:1.24.4 # Update version to match release PR
Example Implementation: PR [#636](https://github.com/openshift/backplane-cli/pull/636): OSD-28717 Fix build failures
Update the dockerfile of backplane-cli with the latest go version and check if build passes.
Check for any issues while updating the dockerfile and start a thread in #sd-ims-backplane channel to mitigate this issue.

## Backplane MCP

The Backplane CLI includes a Model Context Protocol (MCP) server that allows AI assistants to interact with backplane resources and retrieve information about your backplane CLI installation and configuration.

### Overview

The MCP server provides AI assistants with access to backplane functionality through standardized tools. Currently supported tools:

- **`info`**: Get comprehensive information about the backplane CLI installation, configuration, and environment
- **`login`**: Login to a backplane cluster
- **`console`**: Access cluster console via backplane CLI, optionally opening in browser
- **`cluster-resource`**: Execute read-only Kubernetes resource operations (get, describe, logs, top, explain)
- **`cloud-console`**: Get cloud provider console access with temporary credentials

### Running the MCP Server

The backplane MCP server supports two transport methods:

#### Stdio Transport (Default)
For direct integration with AI assistants:
```bash
ocm-backplane mcp
```

#### HTTP Transport
For web-based access and testing:
```bash
# Run on default port 8080
ocm-backplane mcp --http

# Run on custom port
ocm-backplane mcp --http --port 3000
```

### Integration with AI Assistants

#### Gemini CLI Configuration

To use the backplane MCP server with Gemini CLI, create or update your Gemini configuration file:


```yaml
# Gemini CLI Configuration
tools:
mcp:
servers:
backplane:
command: ["ocm-backplane", "mcp"]
description: "OpenShift Backplane CLI integration"
```


#### Claude Desktop Configuration

To integrate with Claude Desktop, add the backplane MCP server to your Claude Desktop configuration:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
"mcpServers": {
"backplane": {
"command": ["ocm-backplane", "mcp"],
"args": [],
}
}
}
```

### Available Tools

#### `info`

Retrieves comprehensive information about your backplane CLI installation.

**What it provides:**
- CLI version information
- Configuration details (URLs, proxy settings, session directory)
- Environment information (home directory, current directory, shell)
- Display and GovCloud settings

#### `login`

Login to a backplane cluster.

**Parameters:**
- `clusterId` (required): The cluster ID to login to

**CLI Flags:**
- `--readonly`: Login with read-only access (calls `/backplane/login/{clusterId}?readonly=true`)
- `--multi` or `-m`: Enable multi-cluster login
- `--pd <incident-id>`: Login using PagerDuty incident ID
- `--ohss <jira-id>`: Login using JIRA ID
- `--manager`: Login to the management cluster
- `--service`: Login to the service cluster
- `--cluster-info`: Print cluster information after login
- `--namespace` or `-n`: Set default namespace (default: "default")

**Example usage:**
```
AI: I'll login to cluster abc123 for you.
[Uses login tool with clusterId: "abc123"]
Successfully logged in to cluster 'abc123'

# With readonly access
$ ocm backplane login abc123 --readonly
```

#### `console`

Access the OpenShift web console for a cluster.

**Parameters:**
- `clusterId` (required): The cluster ID to access console for
- `openInBrowser` (optional): Whether to automatically open console in browser

**Example usage:**
```
AI: I'll access the console for cluster abc123.
[Uses console tool]
Successfully accessed cluster console for 'abc123'
🌐 Console opened in default browser
```

#### `cluster-resource`

Execute read-only Kubernetes resource operations on cluster resources.

**Parameters:**
- `action` (required): Operation to perform (`get`, `describe`, `logs`, `top`, `explain`)
- `resourceType` (optional): Kubernetes resource type (pod, service, deployment, etc.)
- `resourceName` (optional): Specific resource name
- `namespace` (optional): Kubernetes namespace (use 'all' for all namespaces)
- `outputFormat` (optional): Output format (yaml, json, wide, name)
- `labelSelector` (optional): Label selector filter (e.g., 'app=myapp')
- `fieldSelector` (optional): Field selector filter (e.g., 'status.phase=Running')
- `allNamespaces` (optional): Search across all namespaces
- `follow`, `previous`, `tail`, `container` (optional): Logging-specific options

**Example usage:**
```
You: "Show me all pods in the kube-system namespace"
AI: I'll get the pods from kube-system.
[Uses cluster-resource tool: action=get, resourceType=pod, namespace=kube-system]

You: "Get logs for pod xyz-123"
AI: I'll retrieve the logs for that pod.
[Uses cluster-resource tool: action=logs, resourceType=pod, resourceName=xyz-123]

You: "Describe the deployment myapp"
AI: I'll describe the myapp deployment.
[Uses cluster-resource tool: action=describe, resourceType=deployment, resourceName=myapp]
```

#### `cloud-console`

Get cloud provider console access for a cluster with temporary credentials.

**Parameters:**
- `clusterId` (required): The cluster ID to get cloud console access for
- `openInBrowser` (optional): Whether to automatically open the cloud console URL in browser
- `output` (optional): Output format (`text` or `json`, defaults to `json`)
- `url` (optional): Override backplane API URL

**Example usage:**
```
You: "Get cloud console access for cluster xyz789"

AI: I'll get cloud console access for cluster xyz789.

[Uses cloud-console tool with clusterId: "xyz789"]

Successfully retrieved cloud console access for cluster 'xyz789'
🌐 Cloud console opened in default browser
📋 Output format: json
```

### Security Considerations

- All MCP tools provide read-only access to cluster information
- The cluster-resource tool only supports safe, read-only operations (get, describe, logs, top, explain)
- The cloud-console tool provides temporary cloud provider access for debugging and troubleshooting
- Write operations (create, update, delete, patch, apply) are not supported for security
- The server runs with the same permissions as your backplane CLI session
- Cloud console access uses temporary credentials and follows the same security model as the CLI
102 changes: 0 additions & 102 deletions cmd/ocm-backplane/mcp/mcp.go

This file was deleted.

13 changes: 0 additions & 13 deletions cmd/ocm-backplane/mcp/mcp_suite_test.go

This file was deleted.

Loading