Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
echo "All Go files are properly formatted"
- name: Run Go vet
run: go vet ./...
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: "latest"

test:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions internal/jsonrpc2/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,10 @@ func (c *Connection) processResult(from any, req *incomingRequest, result any, e
} else if err != nil {
err = fmt.Errorf("%w: %q notification failed: %v", ErrInternal, req.Method, err)
}
if err != nil {
// TODO: can/should we do anything with this error beyond writing it to the event log?
// (Is this the right label to attach to the log?)
}
}
if err != nil {
// TODO: can/should we do anything with this error beyond writing it to the event log?
// (Is this the right label to attach to the log?)
}

// Cancel the request to free any associated resources.
Expand Down
4 changes: 0 additions & 4 deletions mcp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ type clientSessionState struct {

func (cs *ClientSession) InitializeResult() *InitializeResult { return cs.state.InitializeResult }

func (cs *ClientSession) setConn(c Connection) {
cs.mcpConn = c
}

func (cs *ClientSession) ID() string {
if c, ok := cs.mcpConn.(hasSessionID); ok {
return c.SessionID()
Expand Down
5 changes: 1 addition & 4 deletions mcp/streamable.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (h *StreamableHTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Reque
var transport *StreamableServerTransport
if id := req.Header.Get(sessionIDHeader); id != "" {
h.mu.Lock()
transport, _ = h.transports[id]
transport = h.transports[id]
h.mu.Unlock()
if transport == nil {
http.Error(w, "session not found", http.StatusNotFound)
Expand Down Expand Up @@ -288,9 +288,6 @@ type streamableServerConn struct {
jsonResponse bool
eventStore EventStore

lastStreamID atomic.Int64 // last stream ID used, atomically incremented

opts StreamableServerTransportOptions
incoming chan jsonrpc.Message // messages from the client to the server
done chan struct{}

Expand Down
4 changes: 2 additions & 2 deletions mcp/streamable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ func TestStreamableServerTransport(t *testing.T) {
},
{
name: "background",
tool: func(t *testing.T, ctx context.Context, ss *ServerSession) {
tool: func(t *testing.T, _ context.Context, ss *ServerSession) {
// Perform operations on a background context, and ensure the client
// receives it.
ctx = context.Background()
ctx := context.Background()
if err := ss.NotifyProgress(ctx, &ProgressNotificationParams{}); err != nil {
t.Errorf("Notify failed: %v", err)
}
Expand Down