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:
parent
fd9860c70e
commit
19fb829d4e
Binary file not shown.
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue