The two binaries implement the same lifecycle, with slightly different internal helper packages.
cmd/kubestellar-ops/main.go calls pkg/cmd.Execute().cmd/kubestellar-deploy/main.go calls pkg/deploy/cmd.Execute().--mcp-server.pkg/mcp/server.NewServer or pkg/deploy/mcp.NewServer).initialize returns protocol version, server name and version, and tool capability metadata.tools/list returns the tool catalog and JSON schema for each tool.initialized and notifications/initialized are accepted as notifications without a response.In kubestellar-ops, the stdio loop lives in pkg/mcp/server/server.go and uses bufio.Reader.ReadBytes('\n').
In kubestellar-deploy, the loop is in pkg/deploy/mcp/server.go and uses a bufio.Scanner with a larger buffer for larger payloads.
When Claude Code invokes tools/call:
handleToolsCall or handleToolCall switches on the tool name.Examples:
getClientForCluster() or cluster.Discoverer.multicluster.ClientManager, Executor, and Selector.pkg/gitops.Handlers then execute the real operation:
Finally the server wraps the result into an MCP tools/call response and writes JSON line to stdout.
There is important implementation difference:
kubestellar-ops handlers usually return (string, bool) where the string is preformatted human-readable output and the boolean marks error state.kubestellar-deploy handlers usually return structured Go values that server.go marshals into formatted JSON text for the MCP response body.