MCP SDK v1.3.0: Add client logging and document schema caching#15127
MCP SDK v1.3.0: Add client logging and document schema caching#15127
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add logger to stdio MCP client (connectStdioMCPServer) - Add logger to HTTP MCP client (connectHTTPMCPServer) - Add comment documenting automatic schema caching in v1.3.0+ - Improves debugging and observability when inspecting MCP servers Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the MCP inspection CLI clients to use the MCP SDK v1.3.0 logging hooks for better observability, and adds an inline note about go-sdk’s automatic schema caching behavior.
Changes:
- Configure
mcp.ClientOptions.Loggerfor both stdio and HTTP MCP inspection clients using the existingmcpInspectServerLog. - Add an inline comment in the MCP server noting go-sdk v1.3.0+ automatic schema caching.
- Regenerate workflow compilation artifacts (action pin + workflow lock safe-outputs config changes).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/mcp_inspect_mcp.go |
Adds ClientOptions.Logger to stdio + HTTP MCP clients for debug/trace visibility. |
pkg/cli/mcp_server.go |
Documents schema caching behavior in go-sdk v1.3.0+. |
pkg/workflow/data/action_pins.json |
Adds a new action pin for actions/setup-go@v5. |
.github/workflows/workflow-health-manager.lock.yml |
Updates generated safe-outputs handler config to include update_issue.allow_body:true. |
.github/workflows/sub-issue-closer.lock.yml |
Updates generated safe-outputs handler config to include update_issue.allow_body:true. |
.github/workflows/ci-doctor.lock.yml |
Updates generated safe-outputs handler config to include update_issue.allow_body:true. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":20,\"target\":\"*\"},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"allow_status\":true,\"max\":20,\"target\":\"*\"}}" | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":20,\"target\":\"*\"},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"allow_body\":true,\"allow_status\":true,\"max\":20,\"target\":\"*\"}}" | ||
| with: |
There was a problem hiding this comment.
This lockfile changes GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG to include update_issue.allow_body:true, which is not described in the PR summary. Please confirm this generated safe-outputs config change is intended and either document it in the PR description or move workflow-compilation outputs into a separate PR.
| env: | ||
| GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_issue\":{\"close_older_issues\":true,\"expires\":24,\"labels\":[\"cookie\"],\"max\":1,\"title_prefix\":\"[CI Failure Doctor] \"},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"max\":1}}" | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1},\"create_issue\":{\"close_older_issues\":true,\"expires\":24,\"labels\":[\"cookie\"],\"max\":1,\"title_prefix\":\"[CI Failure Doctor] \"},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"allow_body\":true,\"max\":1}}" | ||
| with: |
There was a problem hiding this comment.
This lockfile now emits update_issue.allow_body:true in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG, which isn’t part of the MCP SDK logging/schema caching changes described in the PR. Please confirm this is an expected regeneration artifact and update the PR description (or split it out) so reviewers understand the intent.
| "actions/setup-go@v5": { | ||
| "repo": "actions/setup-go", | ||
| "version": "v5", | ||
| "sha": "40f1582b2485089dde7abd97c1529aa768e1baff" | ||
| }, |
There was a problem hiding this comment.
This PR changes action_pins.json by adding a new pin for actions/setup-go@v5, but the PR description focuses on MCP SDK logging/schema caching. If this is an intended side-effect of running workflow recompilation (e.g., needed by daily-syntax-error-quality.md), please call it out in the PR description or split these workflow-compilation artifacts into a separate PR to keep the change set focused.
| GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":15},\"create_issue\":{\"expires\":24,\"group\":true,\"labels\":[\"cookie\"],\"max\":10},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"max\":5}}" | ||
| GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":15},\"create_issue\":{\"expires\":24,\"group\":true,\"labels\":[\"cookie\"],\"max\":10},\"missing_data\":{},\"missing_tool\":{},\"update_issue\":{\"allow_body\":true,\"max\":5}}" | ||
| with: |
There was a problem hiding this comment.
The generated workflow lock now includes update_issue.allow_body:true in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG. This is a behavior/permissions change (or at least a change to the emitted config) that isn’t mentioned in the PR description. Please confirm it’s intentional and document why it changed (or separate it from the MCP logging/schema-caching PR).
Implements Priority 1 improvements from Go Fan module review of
modelcontextprotocol/go-sdkv1.3.0.Changes
Add logger to MCP clients: Both stdio and HTTP inspection clients now configure
ClientOptions.Loggerusing the existingmcpInspectServerLoginstance. EnablesDEBUG=cli:mcp_inspect_serverobservability for connection and protocol operations.Document automatic schema caching: Added inline comment noting v1.3.0+ includes automatic schema caching (eliminates reflection overhead per SDK PR Hello from Claude #685). No code change needed; feature already active.
Note: Investigated
ErrSessionMissingsentinel (mentioned in Go Fan report) - not exported in v1.3.0, no string-based error checks requiring replacement found.Original prompt
This section details on the original issue you should resolve
<issue_title>[go-fan] Go Module Review: modelcontextprotocol/go-sdk</issue_title>
<issue_description># 🐹 Go Fan Report: Model Context Protocol Go SDK
Module Overview
The Model Context Protocol (MCP) Go SDK is the official Go implementation for building MCP servers and clients. Maintained in collaboration with Google, it provides comprehensive support for creating AI agent tool interfaces with multiple transport options (stdio, HTTP/SSE, WebSocket).
github.com/modelcontextprotocol/go-sdkCurrent Usage in gh-aw
Implementation Scale
Key Integration Points
Server Implementation (
pkg/cli/mcp_server.go):Tools Exposed:
status- Workflow status monitoringcompile- Workflow compilation with security scanningfix- Automatic codemod applicationinspect- Workflow/schema inspectionmcp-server-add- MCP server configurationmcp-server-operations- Server managementClient Implementation (
pkg/cli/mcp_inspect_mcp.go):View Transport Details
Stdio Transport
HTTP/SSE Transport
Research Findings
Recent SDK Updates (v1.3.0 - Feb 2026)
The latest release brings significant performance and reliability improvements:
🚀 Performance Enhancements
GetError/SetErrornow exported for better debugging🔌 Transport Improvements
DisableListeningoption📝 Logger Modernization
ClientOptions.Logger(PR Overly aggressive string sanitizer #738, 🔧 Add DevContainer Configuration and GitHub Actions Workflows #744)🔒 Security & Quality
ErrSessionMissingnow accessibleBest Practices from Upstream
jsonschematags for automatic schema generationdefer session.Close()Improvement Opportunities
🏃 Quick Wins
1. Add Logger to Client Connections
Current State: Both client instantiations pass
nilfor optionsRecommended:
Impact: Better debugging and observability when inspecting MCP servers
SDK Feature: v1.3.0 modernized logger configuration
2. Verify Schema Caching is Active
Current: May be generating schemas repeatedly for the same types
SDK Feature: v1.3.0 adds automatic schema caching (PR #685)
Action: Verify the optimization is in effect (should be automatic)
Impact: Performance improvement, especially with multiple tool calls
3. Use Exported Error Sentinels
SDK Feature: v1.3.0 now exports
ErrSessionMissing...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.