mcp: ignore notification in stdio batches (#1277)

Fixes #1256
This commit is contained in:
Guglielmo Colombo 2026-09-18 09:26:01 +02:00 • committed by GitHub
commit b58aa8d8d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -734,7 +734,7 @@ func (t *ioConn) Read(ctx context.Context) (jsonrpc.Message, error) {
if batch {
var respBatch *msgBatch // track incoming requests in the batch
for _, msg := range msgs {
if req, ok := msg.(*jsonrpc.Request); ok {
if req, ok := msg.(*jsonrpc.Request); ok && req.IsCall() {
if respBatch == nil {
respBatch = &msgBatch{
unresolved: make(map[jsonrpc2.ID]int),