upgrade
Last updated
Was this helpful?
Last updated
Was this helpful?
Ran tool The v0.21.0 release of brings in a handful of features and fixes that we can immediately adopt to clean up and harden our Slack MCP client:
Upgrade to v0.21.0
– Bump your go.mod
to require github.com/mark3labs/mcp-go v0.21.0
.
– Run go get github.com/mark3labs/mcp-go@v0.21.0 && go mod tidy
.
Unified Transport Interface
– The official client now exposes a transport‐agnostic interface that works over SSE, HTTP, or stdio.
– We should refactor our internal client code to use the new transport.Interface
instead of separate SSE vs. stdio logic. That will simplify switching modes and make our code more resilient to future additions (e.g. WebSockets).
omitempty
on Tool Inputs
– They fixed the issue where empty tool inputs came through as null
by tagging maps with omitempty
.
– Audit our own tool‐input structs (in internal/llms/…
or wherever you define ToolInput
) and add json:"…,omitempty"
to any optional fields so downstream clients (e.g. Claude Desktop) don’t silently skip tools.
Example:
DefaultArray Support
– v0.21.0 adds DefaultArray
so you can specify defaults for array parameters.
– If any of your tools accept array arguments, declare them with the new helper so you don’t have to write manual nil checks.
Tool Annotation Metadata – They introduced a way to annotate tools with rich metadata (id, name, description, etc.). – We can decorate our registered tools with these annotations so that any UI (Cursor, Windsurf) can render nicer tool listings automatically.
Improved SSE Lifecycle
– The new client fixes leaks, adds a cancelSSEStream
helper, and renames done
→closed
.
– Replace any direct SSE usage in our code with the new client’s stream API to get correct cleanup and timeout handling “for free.”
New Error Helper
– There’s now a NewToolResultErrorFromErr
constructor that wraps underlying errors cleanly.
– Use this in your tool‐invocation code so you surface tool failures with proper context.
Next Steps
Update go.mod
and imports.
Run go build
/ go test
and fix any API‐breaking changes (there should be minimal; most of this is additive).
Replace custom transport logic with the unified transport interface.
Add omitempty
tags and default‐array values where appropriate.
Verify that your Slack bot still passes the CI/CD pipeline (lint, tests, Docker, GoReleaser).
By pulling in v0.21.0 you’ll get a more robust, cleaner, and feature‐complete foundation—making it easier to maintain and less error‑prone when connecting to multiple MCP servers over different transports.