Summary
When waza serve is launched by an MCP client (e.g. Claude Code) via stdio, the MCP server never starts because term.IsTerminal(int(os.Stdin.Fd())) returns false for piped stdin. This causes an immediate MCP error -32000: Connection closed on the client side.
Reproduction
- Configure
~/.claude.json:
{
"mcpServers": {
"waza": {
"command": "waza",
"args": ["serve"]
}
}
}
-
Launch Claude Code — waza MCP fails with Connection closed.
-
Root cause in cmd/waza/cmd_serve.go:
if term.IsTerminal(int(os.Stdin.Fd())) {
go func() {
logger.Info("MCP server running on stdio")
mcp.ServeStdio(ctx, os.Stdin, os.Stdout, logger)
}()
}
MCP clients communicate over stdio pipes, so IsTerminal is always false — the MCP server is never started.
Proposed Solution
Add an environment variable (e.g. WAZA_MCP_STDIO=1) or a CLI flag (e.g. --mcp-stdio) to bypass the terminal check:
if term.IsTerminal(int(os.Stdin.Fd())) || os.Getenv("WAZA_MCP_STDIO") == "1" {
go func() {
logger.Info("MCP server running on stdio")
mcp.ServeStdio(ctx, os.Stdin, os.Stdout, logger)
}()
}
This would allow MCP clients like Claude Code, Copilot CLI, and others to use waza serve as an MCP server.
Environment
- waza v0.33.0
- macOS (darwin/arm64)
- Claude Code (MCP client, stdio transport)
Summary
When
waza serveis launched by an MCP client (e.g. Claude Code) via stdio, the MCP server never starts becauseterm.IsTerminal(int(os.Stdin.Fd()))returnsfalsefor piped stdin. This causes an immediateMCP error -32000: Connection closedon the client side.Reproduction
~/.claude.json:{ "mcpServers": { "waza": { "command": "waza", "args": ["serve"] } } }Launch Claude Code — waza MCP fails with
Connection closed.Root cause in
cmd/waza/cmd_serve.go:MCP clients communicate over stdio pipes, so
IsTerminalis alwaysfalse— the MCP server is never started.Proposed Solution
Add an environment variable (e.g.
WAZA_MCP_STDIO=1) or a CLI flag (e.g.--mcp-stdio) to bypass the terminal check:This would allow MCP clients like Claude Code, Copilot CLI, and others to use
waza serveas an MCP server.Environment