Add stdout flush for MCP protocol reliability

- Flush stdout after each JSON-RPC response
- Ensures responses are immediately available to MCP clients
This commit is contained in:
Levi Neely 2026-02-18 21:42:32 +01:00
parent fd9860c70e
commit 19fb829d4e
2 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -300,6 +300,7 @@ func sendResponse(id interface{}, result interface{}) {
}
data, _ := json.Marshal(resp)
fmt.Println(string(data))
os.Stdout.Sync()
}
func sendError(id interface{}, code int, message string) {
@ -310,4 +311,5 @@ func sendError(id interface{}, code int, message string) {
}
data, _ := json.Marshal(resp)
fmt.Println(string(data))
os.Stdout.Sync()
}