Skip to content

Fix mcptool package doc: it claims a WebSocket transport the MCP go-sdk does not provide#755

Open
PratikDhanave wants to merge 2 commits into
microsoft:mainfrom
PratikDhanaveFork:fix-mcptool-websocket-doc
Open

Fix mcptool package doc: it claims a WebSocket transport the MCP go-sdk does not provide#755
PratikDhanave wants to merge 2 commits into
microsoft:mainfrom
PratikDhanaveFork:fix-mcptool-websocket-doc

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

The mcptool package doc comment claimed agents could connect to MCP servers "via stdio, HTTP, or WebSocket". Connect only wraps an mcp.Transport supplied by the pinned go-sdk (v1.6.1), and that SDK provides no WebSocket transport — the only Transport implementations are CommandTransport, IOTransport, InMemoryTransport, LoggingTransport, SSEClientTransport, SSEServerTransport, StdioTransport, StreamableClientTransport, and StreamableServerTransport. The reachable client transports for external servers are stdio (subprocess) and HTTP (SSE / streamable HTTP) only.

This updates the doc to describe the transports that are actually available:

via stdio (subprocess) or HTTP (SSE / streamable HTTP)

Why

Aligns the doc with the SDK surface, matching the .NET/Python MCP client wording, which likewise scopes advertised transports to stdio and HTTP-based transports (SSE / streamable HTTP) rather than WebSocket. A reader who trusted the old comment would look for a WebSocket transport that cannot be constructed or passed to Connect.

Scope is intentionally limited to the WebSocket claim; the "and prompts" clause (#628) and the agent.Tool wording (#685) are left to their respective PRs.

Testing

Doc-only change. Added TestPackageDocNoWebSocket in mcp_test.go as a regression guard that scans the package's non-test .go sources and fails if any mention "websocket". It fails on the old wording and passes on the new. go build ./..., go vet ./tool/mcptool/..., and go test ./tool/mcptool/... all pass.

Copilot AI review requested due to automatic review settings July 24, 2026 04:23
@PratikDhanave
PratikDhanave requested a review from a team as a code owner July 24, 2026 04:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the tool/mcptool package documentation to remove an inaccurate claim that MCP servers can be connected to via WebSocket, aligning the doc with the transports available in the pinned MCP Go SDK. It also adds a regression test to prevent reintroducing “WebSocket” mentions in non-test Go sources for the package.

Changes:

  • Update the mcptool package doc to describe supported connection transports as stdio (subprocess) and HTTP (SSE / streamable HTTP).
  • Add TestPackageDocNoWebSocket to fail if any non-test .go file in tool/mcptool contains the substring “websocket”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tool/mcptool/mcp.go Adjusts package-level documentation to remove the WebSocket transport claim.
tool/mcptool/mcp_test.go Adds a regression test scanning non-test sources for “websocket” mentions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tool/mcptool/mcp.go Outdated
Comment on lines +3 to +6
// 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in e42f4f2: the package doc no longer claims prompt support and now says it wraps MCP tools as tool.Tool / tool.FuncTool (there is no agent.Tool type here).

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
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.
@PratikDhanave
PratikDhanave force-pushed the fix-mcptool-websocket-doc branch from e42f4f2 to 588cdb1 Compare July 24, 2026 09:29
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review — PR #755

Scope: Documentation-only fix (tool/mcptool/ package doc comment + regression test).

Finding: No exported Go API changes. The PR corrects a misleading doc claim that the mcptool package supports WebSocket transport — the pinned MCP go-sdk (v1.6.1) provides no WebSocket transport. The new wording (via stdio (subprocess) or HTTP (SSE / streamable HTTP)) aligns with the transport scope described in the .NET and Python MCP client documentation.

Verdict: ✅ No cross-repo parity issues. The change improves documentation consistency with upstream .NET/Python rather than diverging from it. No exported API surface was modified.

parity-approved label retained — no further action required.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 15.3 AIC · ⌖ 5.54 AIC · ⊞ 5.9K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants