Skip to content

Commit b7ce0f5

Browse files
committed
docs: add Claude Code configuration and troubleshooting guide
- Add Claude Code section with tested JSON configuration command - Include troubleshooting guidance for stdio transport connection issues - Explain that health check failures are normal but don't affect functionality - Document proper environment variable handling for KUBECONFIG - Provide user-level scope installation for cross-project availability Resolves common 'Failed to connect' issues by using JSON format instead of command-line args
1 parent 1bd0b32 commit b7ce0f5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,31 @@ extensions:
128128

129129
```
130130

131+
### Claude Code
132+
133+
[Claude Code](https://claude.ai/code) provides an integrated command-line interface for Claude with MCP server support.
134+
135+
For reliable connection with Claude Code, use the JSON configuration format:
136+
137+
```bash
138+
claude mcp add-json kubectl '{"command":"npx","args":["-y","kubernetes-mcp-server@latest"],"env":{"KUBECONFIG":"${HOME}/.kube/config"}}' -s user
139+
```
140+
141+
This ensures:
142+
- ✅ Reliable stdio transport connection
143+
- ✅ User-level scope (works across all projects)
144+
- ✅ Proper environment variable handling
145+
- ✅ Auto-managed server lifecycle
146+
147+
#### Troubleshooting
148+
149+
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.
150+
151+
For connection issues, ensure you're using:
152+
- **JSON format**: Use `claude mcp add-json` with proper JSON structure instead of command-line arguments
153+
- **Separate args array**: `"args":["-y","kubernetes-mcp-server@latest"]` instead of combined strings
154+
- **Environment variables**: Set `KUBECONFIG` in the `env` object for proper kubectl access
155+
131156
## 🎥 Demos <a id="demos"></a>
132157

133158
### Diagnosing and automatically fixing an OpenShift Deployment

0 commit comments

Comments
 (0)