perf: integrate go-sdk schema caching optimization (Phase 1)#1533
perf: integrate go-sdk schema caching optimization (Phase 1)#1533
Conversation
Add replace directive to use github.com/SamMorrowDrums/go-sdk fork with schema caching optimization for improved tool registration performance. Expected improvements: - 132x faster tool registration - 51x fewer allocations - 19% faster per-tool-call validation Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
|
@copilot Run licenses check |
Run script/licenses to update license files after adding the replace directive for github.com/SamMorrowDrums/go-sdk fork. Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Ran Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Update RequiredThe upstream go-sdk PR has been cleaned up based on reviewer feedback. The input validation optimization (ApplyDefaults on structs) was removed because it's fundamentally broken per the jsonschema-go maintainer. What changed in go-sdk PR #685:
New commit to reference:replace github.com/modelcontextprotocol/go-sdk => github.com/SamMorrowDrums/go-sdk v0.0.0-20251205102140-988974db6bfbThe old commit Performance impact: Still get the 132x faster tool registration from schema caching, just without the per-call validation optimization (which was wrong anyway). |
The upstream go-sdk PR was cleaned up based on reviewer feedback: - Removed broken input validation optimization (ApplyDefaults on structs) - Fixed sync.Map.Clear() usage - Fixed benchmark naming New commit 988974db6bfb contains only the schema caching optimization.
|
ghcr.io/github/github-mcp-server |
|
Superseded by #1865 which upgrades go-sdk to the latest HEAD that includes the schema caching feature (modelcontextprotocol/go-sdk#685). |
Closes: #767
Integrates schema caching optimization from go-sdk fork to eliminate expensive reflection-based schema generation on every
AddToolcall. Critical for stateless server patterns where a new server is created per HTTP request.Benchmark improvements:
Changes
replacedirective ingo.modpointing togithub.com/SamMorrowDrums/go-sdkfork with schema cachinggo.sumwith fork dependenciesscript/licensesNo code changes required—optimization is transparent to integrators.
Tradeoffs
Using a fork temporarily until the optimization is merged upstream. The fork tracks the
perf/phase1-schema-cachebranch from SamMorrowDrums/go-sdk#1.Alternatives
Could wait for upstream merge, but the performance impact on stateless server patterns is significant enough to warrant immediate integration.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.