Skip to content

Commit

Permalink
✨ Add full protocol support to SSE server
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen committed Jan 21, 2025
1 parent df35321 commit 2b61b22
Show file tree
Hide file tree
Showing 3 changed files with 324 additions and 28 deletions.
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,11 @@ Made Tool an interface with accessors and context-aware Call method for better e
- Changed Tool from struct to interface with GetName, GetDescription, GetInputSchema and Call methods
- Added ToolImpl as a basic implementation of the Tool interface
- Updated Registry, Client and CLI to use the new Tool interface
- Added context support throughout the tool invocation chain
- Added context support throughout the tool invocation chain

# SSE Server Message Handling

Added support for all MCP protocol methods in the SSE server implementation:
- Updated SSEServer to use all services (prompt, resource, tool, initialize)
- Added handlers for all protocol methods (prompts/list, prompts/get, resources/list, resources/read, tools/list, tools/call)
- Improved error handling and response formatting
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (s *Server) StartStdio(ctx context.Context) error {
func (s *Server) StartSSE(ctx context.Context, port int) error {
s.mu.Lock()
s.logger.Debug().Int("port", port).Msg("Creating SSE transport")
sseServer := NewSSEServer(s.logger, s.registry, port)
sseServer := NewSSEServer(s.logger, s.promptService, s.resourceService, s.toolService, s.initializeService, port)
s.transport = sseServer
s.mu.Unlock()

Expand Down
Loading

0 comments on commit 2b61b22

Please sign in to comment.