Claude MCP Client - Go Version¶
Setup¶
Install dependencies:
cd toolsforlocal
go mod tidy
Set your Claude API key:
export ANTHROPIC_API_KEY='sk-ant-...' # Your actual key
Start port-forward:
kubectl port-forward -n canvas svc/pdb-management-mcp-service 8090:8090
Build and run:
go build -o claude-mcp claude_mcp_client.go
./claude-mcp
Usage¶
Interactive Commands:¶
analyze pdb-demo- Analyze namespace availabilityrecommend pdb-demo- Get policy recommendationsquit- Exit
As a library:¶
import "path/to/toolsforlocal"
// Initialize
integration, err := NewClaudeMCPIntegration(apiKey, "http://localhost:8090/mcp")
if err != nil {
log.Fatal(err)
}
// Use it
ctx := context.Background()
response, err := integration.AnalyzeNamespace(ctx, "pdb-demo")
fmt.Println(response)
Features¶
Native Go implementation
Uses official Anthropic SDK
Direct MCP server communication
Tool calling support
Interactive CLI mode
Advantages over Python¶
Single binary deployment
No virtual environment needed
Better performance
Native to your PDB operator codebase
Can be integrated directly into operator if needed