diff --git a/main.go b/main.go index 810e9c2..95e7c05 100644 --- a/main.go +++ b/main.go @@ -246,10 +246,7 @@ func writeResponse(resp interface{}) { } func writeFramed(data []byte) { - // MCP stdio transport uses newline-delimited JSON (NDJSON), not LSP-style - // Content-Length framing. Claude Code and other MCP clients reject - // Content-Length headers on stdio, so we emit one JSON object per line. - fmt.Fprintf(os.Stdout, "%s\n", data) + fmt.Fprintf(os.Stdout, "Content-Length: %d\r\n\r\n%s", len(data), data) } func debugLog(format string, args ...interface{}) {