Skip to content
Open
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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,31 @@ extensions:

```

### Claude Code

[Claude Code](https://claude.ai/code) provides an integrated command-line interface for Claude with MCP server support.

For reliable connection with Claude Code, use the JSON configuration format:

```bash
claude mcp add-json kubectl '{"command":"npx","args":["-y","kubernetes-mcp-server@latest"],"env":{"KUBECONFIG":"${HOME}/.kube/config"}}' -s user
```

This ensures:
- ✅ Reliable stdio transport connection
- ✅ User-level scope (works across all projects)
- ✅ Proper environment variable handling
- ✅ Auto-managed server lifecycle

#### Troubleshooting

If you see "Failed to connect" in health checks but the server works when you run kubectl commands, this is expected behavior. The health check timeout may be too aggressive for stdio transport, but the server will function correctly when Claude Code actually uses it.

For connection issues, ensure you're using:
- **JSON format**: Use `claude mcp add-json` with proper JSON structure instead of command-line arguments
- **Separate args array**: `"args":["-y","kubernetes-mcp-server@latest"]` instead of combined strings
- **Environment variables**: Set `KUBECONFIG` in the `env` object for proper kubectl access

## 🎥 Demos <a id="demos"></a>

### Diagnosing and automatically fixing an OpenShift Deployment
Expand Down