mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
a75fdb8040
Split business executors from federation sources and migrate unified tool/federation transports to the official go-sdk for stricter MCP compliance and safer session lifecycle handling. Add targeted regression tests for accept compatibility, initialization retries, pending cleanup, and include updated swagger artifacts.
19 lines
388 B
Go
19 lines
388 B
Go
package mcp
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strings"
|
|
)
|
|
|
|
func IsNotification(req JSONRPCRequest) bool {
|
|
return len(req.ID) == 0 && strings.HasPrefix(req.Method, "notifications/")
|
|
}
|
|
|
|
func JSONRPCErrorResponse(id json.RawMessage, code int, message string) JSONRPCResponse {
|
|
return JSONRPCResponse{
|
|
JSONRPC: "2.0",
|
|
ID: id,
|
|
Error: &JSONRPCError{Code: code, Message: message},
|
|
}
|
|
}
|