Skip to content

Conversation

rafilkmp3
Copy link

Summary

This PR adds comprehensive Claude Code configuration documentation to help users easily set up the kubernetes-mcp-server with Claude Code CLI.

Changes Made

  • Added Claude Code section to README.md with tested configuration command
  • Included troubleshooting guidance for common stdio transport connection issues
  • Documented proper JSON format usage to avoid "Failed to connect" errors
  • Explained environment variable handling for KUBECONFIG
  • Added user-level scope installation instructions for cross-project availability

Key Configuration

The documented command that works reliably:

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

Problem Solved

Many users experience "Failed to connect" issues when trying to add this MCP server to Claude Code. This documentation provides:

  1. Correct JSON format instead of command-line argument format
  2. Proper environment variable setup for kubectl access
  3. Troubleshooting guidance explaining that health check failures are normal but don't affect functionality
  4. User-level scope configuration for cross-project availability

Testing

The configuration has been tested and verified to work with Claude Code, providing reliable kubectl functionality across all projects.

Documentation Placement

The new Claude Code section is positioned after the Goose CLI section, maintaining consistency with other tool integrations in the README.

This change makes it significantly easier for Claude Code users to integrate kubernetes-mcp-server into their workflow with a single, tested command.

- 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

Signed-off-by: Rafael Sathler <[email protected]>
@rafilkmp3 rafilkmp3 force-pushed the docs/claude-code-configuration branch from b7ce0f5 to 0794da5 Compare August 27, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant