Repository navigation
Releases
v0.6.2
This update improves the SSE client implementation by expanding accepted HTTP response codes and fixing URL handling, resulting in better compatibility with various server configurations and more reliable message processing for server-sent events.
Changed
- Enhance
SSEClientto accept both HTTP status codes 200 (OK) and 202 (Accepted) as valid server responses, improving compatibility with different server implementations.
Fixed
- Correct
SSEClientURL handling to properly process relative message URLs provided by the server, ensuring proper resource resolution.
v0.6.1
This update introduces comprehensive logging configuration options for all components (client, server, StdIO, and SSE) and improves URL handling in the SSE server by automatically converting relative URLs to absolute URLs, enhancing reliability in various deployment scenarios.
Added
- Add
WithClientLoggerandWithServerLoggeroptions for customized client and server logging configuration. - Add
WithStdIOLoggeroption forStdIOlogging configuration. - Add
WithSSEClientLoggerandWithSSEServerLoggeroptions forSSEClientandSSEServerlogging configuration. - Add
WithSSESchemeoption to specify protocol (HTTP/HTTPS) forSSEServermessage URL construction. Thanks @mikaelmorvan.
Changed
- Enhance
SSEServerto automatically convert relative message URLs to absolute URLs, improving compatibility across different environments. Thanks @mikaelmorvan.
v0.6.0
This release focuses on significant architectural improvements, introducing the new Server struct with comprehensive ping management capabilities, enhanced connection lifecycle options, and a more responsive client connection model. The changes provide better resource management through dedicated session control methods and a new in-memory server implementation, while simplifying the timeout handling approach through context-based parameters.
Added
- Add automatic server session closure when ping timeout threshold is exceeded.
- Add
Serverstruct that replaces the previousServefunction with equivalent functionality. - Add ping management options for server:
WithServerPingTimeoutandWithServerPingTimeoutThreshold. - Add server lifecycle callback options:
WithServerOnClientConnectedandWithServerOnClientDisconnected. - Add connection management methods:
DisconnectforClientstruct andShutdownforServerTransportinterface. - Add ping management options for client:
WithClientPingTimeoutandWithClientOnPingFailed. - Add
Stopmethod toSessioninterface for controlled session termination. - Add
WithSSEClientMaxPayloadSizeoption to configure maximum payload size in SSE clients. - Add
memoryserver implementation.
Changed
- Modify
Connectmethod to return immediately after session establishment instead of blocking indefinitely. - Update
StartSessionmethod inClientTransportto return aSessionobject instead of an iterator.
Removed
- Remove
WithServerWriteTimeoutandWithServerReadTimeoutoptions as they are no longer necessary with the new timeout model. - Remove
WithClientWriteTimeoutandWithClientReadTimeoutoptions in favor of using context timeout parameters. - Remove
Servefunction in favor of the more flexibleServerstruct implementation. - Remove
Sendfunction fromClientTransportinterface as this functionality is now handled by theSessioninterface.
v0.5.1
This release focuses on improving error handling and filesystem server compatibility. Key improvements include enhanced error messaging in the JSONRPCError struct, better filesystem server alignment with the official MCP implementation, and the addition of comprehensive testing. These changes significantly improve debugging capabilities and ensure more reliable filesystem operations.
Added
- Add comprehensive test suite for
filesystemserver implementation to ensure reliability and correctness.
Changed
- Enhance filesystem server compatibility with official MCP implementation.
- Improve error message clarity in JSONRPCError struct for better debugging.
- Implement detailed error string representation in JSONRPCError struct, replacing generic "Internal error" messages.
- Add specific error handling for CallTool requests with dedicated CallToolResult error reporting.
- Exclude .git directory from directory_tree tool results to improve relevance of
filesystemoperations.
v0.5.0
This release focuses on improving JSON serialization flexibility and simplifying I/O interfaces. The changes include making annotations optional in resource types and streamlining the StdIO transport implementation by delegating closing responsibilities to callers.
Changed
- Make
Annotationsfield nullable in resource types to support optional JSON serialization. - Simplify
StdIOtransport by usingio.Readerandio.Writerinterfaces instead of closeable variants.
Removed
- Remove
Closemethod fromStdIOtransport as part of I/O interface simplification.
v0.4.2
This release introduces a new capability for runtime server information retrieval through the ServerInfo method, enabling clients to dynamically access server configuration and capabilities without additional setup requirements.
Added
ServerInfomethod toClientstruct for retrieving server information and capabilities at runtime.
v0.4.1
This release implements audio content support as specified in the latest MCP specification update, adding necessary enum values and maintaining consistency with existing content type structures. The changes enable seamless integration of audio processing capabilities while preserving compatibility with existing image content handling patterns.
Added
ContentTypeAudiotoContentTypeenum.
v0.4.0
This release changes how clients handle server capabilities during initialization. Instead of requiring users to define server capabilities when creating a client, which proved impractical in real-world usage where MCP hosts often lack compile-time knowledge of server capabilities, the client can now connect to any server and dynamically check for desired capabilities. This is implemented through new methods like PromptServerSupported and ResourceServerSupported, allowing runtime verification of specific server features.
Added
- Added
PromptServerSupported,ResourceServerSupported,ToolServerSupported, andLoggingServerSupportedmethods toClientstruct to check if the server supports specific features. - Added more tests for
mcppackage.
Removed
ServerRequirementfor creating a new client.
v0.3.1
This release focuses on adhering to the official JSON Schema specification and improving metadata management. Key changes include the introduction of unified resource content handling, enhanced annotation support, and simplified JSON handling by removing third-party schema validation dependencies. The changes in Tool's InputSchema and CallToolParams' Arguments provide more flexibility by allowing users to implement their own JSON Schema validation.
Added
Annotationsstruct for metadata managementResourceContentsstruct for unified text and blob handlingUnsubscribeResourcefunction in subscription handlerWithInstructionsserver option for client guidanceStringmethod forLogLeveltype
Changed
- Rename
PromptRoletoRolefor better clarity - Enhance
Contentstructure with newAnnotationsandResourceContentfields - Update resource handling to use
ResourceContentfor embedded resources - Add pagination support with
CursorandNextCursorfields in template operations - Add
Totalfield to completion results for progress tracking - Implement
Annotationssupport acrossResourceandResourceTemplatetypes - Update
LogDatato usejson.RawMessagefor flexible data handling - Change
InputSchemafield inToolstruct to usejson.RawMessagetype - Change
Argumentsfield inCallToolParamsstruct to usejson.RawMessage - Adjust
filesystemandeverythingservers for current schema
Removed
- Remove
TextandBlobfields fromResourcetype (functionality moved toResourceContent)
v0.3.0
This release introduces significant improvements in API consistency and modernizes the codebase by adopting Go 1.23's iterator pattern. Key changes include restructured parameter naming conventions, simplified package organization, enhanced transport interfaces, and improved SSE handling through the integration of go-sse library. The adoption of iterators for handling sessions, messages, and streaming operations provides a more efficient and safer alternative to channels for sequential data processing.
Added
Sessioninterface for handling session onServerTransportinterfaces.ProgressReporterfunction type for reporting progress in server primitive operationsResourceSubscriptionHandlerinterface for handling resource subscriptions.
Changed
- Refactored parameter naming convention for
Clientrequest methods to improve consistency between method names and their parameters. Previously, parameter names likePromptsListParamsandPromptsGetParamsused noun-verb style while methods used verb-noun style. Now, parameter names follow the same verb-noun pattern as their corresponding methods (e.g.,ListPromptsParamsandGetPromptParams). - Refactored the result name of the request calls, either in
ClientorServerinterfaces. This is done to improve consistency between method names and their results. For example,ListPromptsnow returnsListPromptsResultinstead ofPromptList. - Use structured parameter types (such as
ListPromptsParamsorGetPromptParams) inClientmethod signatures when making server requests, rather than using individual parameters. For example, instead of passing separatecursorandprogressTokenparameters toListPrompts, ornameandargumentstoGetPrompt, use a dedicated parameter struct. - Utilize
go-sseto handleSSEClientby @tmaxmax. - Utilize
go-sse'sSessionto sent the event messages fromSSEServer. - Moved
mcppackage frompkg/mcpto root folder andpkg/serverspackage toserverspackage to simplify import paths. Thepkgdirectory added unnecessary nesting and noise in import paths (e.g., fromgithub.com/MegaGrindStone/go-mcp/pkg/mcptogithub.com/MegaGrindStone/go-mcp, and fromgithub.com/MegaGrindStone/go-mcp/pkg/serverstogithub.com/MegaGrindStone/go-mcp/servers). - Split
Transportinterface intoServerTransportandClientTransportinterfaces.ClientTransportdoesn't need session-based messages asClientwould just use oneSessionin its lifecycle. - Use iterator pattern for sessions in
ServerTransportand messages inClientTransport. - Use iterator pattern for streaming logs in
LogHandler. - Use iterator pattern for all the updaters.
- Use
io.ReadCloserandio.WriteCloserforStdIOtransport. - Adjust
everythingserver for current interfaces. - Adjust
filesystemserver for current interfaces.
Removed
pkg/mcppackage (moved to root for cleaner imports).pkg/serverspackage (moved toserversfor cleaner imports).Transportinterface (replaced byServerTransportandClientTransport)ProgressReporterinterface (replaced with function type for simpler progress reporting)ResourceSubscribedUpdaterinterface (replaced withResourceSubscriptionHandler)