Skip to content

Commit 7b9d991

Browse files
committed
Merge branch 'main' of github.com:mark3labs/mcp-go into feature/protocol-negotiation
2 parents 557a80c + 5800c20 commit 7b9d991

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

client/transport/stdio.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ func (c *Stdio) SendRequest(
307307
ctx context.Context,
308308
request JSONRPCRequest,
309309
) (*JSONRPCResponse, error) {
310+
// Check if context is already canceled before doing any work
311+
select {
312+
case <-ctx.Done():
313+
return nil, ctx.Err()
314+
default:
315+
}
316+
310317
if c.stdin == nil {
311318
return nil, fmt.Errorf("stdio client not started")
312319
}

0 commit comments

Comments
 (0)