Skip to content

Commit 65010c4

Browse files
authored
chore: drop unused fields from sseSession (#303)
1 parent 28c9cc3 commit 65010c4

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

server/sse.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ import (
2020

2121
// sseSession represents an active SSE connection.
2222
type sseSession struct {
23-
writer http.ResponseWriter
24-
flusher http.Flusher
2523
done chan struct{}
2624
eventQueue chan string // Channel for queuing events
2725
sessionID string
2826
requestID atomic.Int64
2927
notificationChannel chan mcp.JSONRPCNotification
3028
initialized atomic.Bool
31-
loggingLevel atomic.Value
29+
loggingLevel atomic.Value
3230
tools sync.Map // stores session-specific tools
3331
}
3432

@@ -55,11 +53,11 @@ func (s *sseSession) Initialized() bool {
5553
return s.initialized.Load()
5654
}
5755

58-
func(s *sseSession) SetLogLevel(level mcp.LoggingLevel) {
56+
func (s *sseSession) SetLogLevel(level mcp.LoggingLevel) {
5957
s.loggingLevel.Store(level)
6058
}
6159

62-
func(s *sseSession) GetLogLevel() mcp.LoggingLevel {
60+
func (s *sseSession) GetLogLevel() mcp.LoggingLevel {
6361
level := s.loggingLevel.Load()
6462
if level == nil {
6563
return mcp.LoggingLevelError
@@ -92,9 +90,9 @@ func (s *sseSession) SetSessionTools(tools map[string]ServerTool) {
9290
}
9391

9492
var (
95-
_ ClientSession = (*sseSession)(nil)
96-
_ SessionWithTools = (*sseSession)(nil)
97-
_ SessionWithLogging = (*sseSession)(nil)
93+
_ ClientSession = (*sseSession)(nil)
94+
_ SessionWithTools = (*sseSession)(nil)
95+
_ SessionWithLogging = (*sseSession)(nil)
9896
)
9997

10098
// SSEServer implements a Server-Sent Events (SSE) based MCP server.
@@ -301,8 +299,6 @@ func (s *SSEServer) handleSSE(w http.ResponseWriter, r *http.Request) {
301299

302300
sessionID := uuid.New().String()
303301
session := &sseSession{
304-
writer: w,
305-
flusher: flusher,
306302
done: make(chan struct{}),
307303
eventQueue: make(chan string, 100), // Buffer for events
308304
sessionID: sessionID,

0 commit comments

Comments
 (0)