From da7b1a4777fbdc7adfc4f41ef5128e0075e1570a Mon Sep 17 00:00:00 2001 From: PratikDhanave Date: Fri, 24 Jul 2026 09:53:34 +0530 Subject: [PATCH 1/2] Fix mcptool package doc to drop unsupported WebSocket transport Connect only wraps an mcp.Transport supplied by the pinned go-sdk, which exposes stdio and HTTP (SSE / streamable HTTP) transports but no WebSocket transport, so the package doc's "stdio, HTTP, or WebSocket" claim is inaccurate. Describe the transports that are actually reachable and add a regression guard test. --- tool/mcptool/mcp.go | 5 +++-- tool/mcptool/mcp_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tool/mcptool/mcp.go b/tool/mcptool/mcp.go index 28ebd695..3adec999 100644 --- a/tool/mcptool/mcp.go +++ b/tool/mcptool/mcp.go @@ -1,8 +1,9 @@ // Copyright (c) Microsoft. All rights reserved. // Package mcp provides integration with the Model Context Protocol (MCP). -// It allows agents to connect to external MCP servers via stdio, HTTP, or WebSocket -// and expose their tools and prompts as agent.Tool instances. +// It allows agents to connect to external MCP servers via stdio (subprocess) +// or HTTP (SSE / streamable HTTP) and expose their tools and prompts as +// agent.Tool instances. package mcptool import ( diff --git a/tool/mcptool/mcp_test.go b/tool/mcptool/mcp_test.go index 28738253..6465951e 100644 --- a/tool/mcptool/mcp_test.go +++ b/tool/mcptool/mcp_test.go @@ -7,6 +7,8 @@ import ( "encoding/base64" "encoding/json" "errors" + "os" + "path/filepath" "strings" "testing" @@ -1026,3 +1028,27 @@ func TestAddToolTypedNilContentDoesNotPanic(t *testing.T) { t.Fatalf("content = %#v, want a TextContent containing \"null\"", contents[0]) } } + +// TestPackageDocNoWebSocket guards against re-introducing the inaccurate +// claim that mcptool supports a WebSocket transport. Connect only wraps an +// mcp.Transport supplied by the pinned go-sdk, which offers stdio and HTTP +// (SSE / streamable HTTP) transports but no WebSocket transport. +func TestPackageDocNoWebSocket(t *testing.T) { + entries, err := os.ReadDir(".") + if err != nil { + t.Fatalf("ReadDir(.) error = %v", err) + } + for _, e := range entries { + name := e.Name() + if e.IsDir() || !strings.HasSuffix(name, ".go") || strings.HasSuffix(name, "_test.go") { + continue + } + data, err := os.ReadFile(filepath.Join(".", name)) + if err != nil { + t.Fatalf("ReadFile(%s) error = %v", name, err) + } + if strings.Contains(strings.ToLower(string(data)), "websocket") { + t.Errorf("%s mentions WebSocket, but the go-sdk provides no WebSocket transport", name) + } + } +} From 588cdb10526ec66a3f9a9ef1d46f54c536de87de Mon Sep 17 00:00:00 2001 From: PratikDhanave Date: Fri, 24 Jul 2026 14:58:14 +0530 Subject: [PATCH 2/2] Correct mcptool package doc: no prompts, wraps as tool.Tool/FuncTool --- tool/mcptool/mcp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/mcptool/mcp.go b/tool/mcptool/mcp.go index 3adec999..081857e2 100644 --- a/tool/mcptool/mcp.go +++ b/tool/mcptool/mcp.go @@ -2,8 +2,8 @@ // Package mcp provides integration with the Model Context Protocol (MCP). // It allows agents to connect to external MCP servers via stdio (subprocess) -// or HTTP (SSE / streamable HTTP) and expose their tools and prompts as -// agent.Tool instances. +// or HTTP (SSE / streamable HTTP) and expose their tools as +// tool.Tool / tool.FuncTool instances. package mcptool import (