Skip to content

Conversation

@cliffhall
Copy link
Member

@cliffhall cliffhall commented Sep 2, 2025

Description

  • in .gitignore
    • add .idea/ for Jetbrains IDEs
  • in everything.ts
    • remove import of SetLevelRequestSchema
    • remove logLevel var
    • add sessionId var
    • in startNotificationIntervals function
      • add optional sid argument
      • set sessionId to sid
      • define messages to be sent, adding sessionId if present
    • remove setRequestHandler call for SetLevelRequestSchema
    • replace server.notification calls that sent "notifications/message" objects with calls to server.sendLoggingMessage, passing just the parameters and sessionId.
  • In package.json & package-lock.json
    • bump TS SDK version to 1.17.5
  • In sse.ts, pass transport.sessionId to startNotificationIntervals call
  • In stdio.ts
    • destructure startNotificationIntervals from createServer call
    • implement custom logging request handler and server.sendLoggingMessage implementation, as a workaround for the fact that the SDK's automatic log level handling currently only tracks requested log level by session id. This will be fixed in a followup PR for the SDK
    • call the startNotificationIntervals function after connecting the transport to the server
  • In streamableHttp.ts
    • destructure startNotificationIntervals from createServer call
    • call startNotificationIntervals passing the transport.sessionId after connecting the transport to the server

Server Details

  • Server: Everything
  • Changes to: logging

Motivation and Context

  1. A Regression: The Everything server has stopped sending regular subscription update and log notifications for the streamableHttp and stdio servers. This happened in 2569 - Fix SSE server crash by starting notification timers only after client connects. It returns a startNotificationIntervals function reference from the createServer function, but the non-sse callers never invoke it.
  2. The TypeScript SDK now has support for automatic log level handling. This PR updates the SDK version to get that functionality, and refactors the Everything servers to remove its internal log level handling functionality and use the server.sendLoggingMessage function rather than send.notification which is required for the log level filtering to be applied.
  3. The TypeScript SDK's automatic log level handling currently tracks the requested level by sessionId. However STDIO doesn't have sessionIds, so this PR adds a workaround for the Everything STDIO server so that it tracks its own logging level. This will be removed after a followup PR to the SDK to allow tracking when there isn't a sessionId.

How Has This Been Tested?

With StreamableHttps transport

SHTTP

With SSE transport

SSE

With STDIO transport

STDIO

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

Companion to this Inspector PR

  - add .idea/ for Jetbrains IDEs
* in everything.ts
  - remove import of SetLevelRequestSchema
  - remove logLevel var
  - add sessionId var
  - in startNotificationIntervals function
    - add optional sid argument
    - set sessionId to sid
    - define messages to be sent, adding sessionId if present
  - remove setRequestHandler call for SetLevelRequestSchema
  - replace server.notification calls that sent "notifications/message" objects with calls to server.sendLoggingMessage, passing just the parameters and sessionId.
* In package.json & package-lock.json
  - bump TS SDK version to 1.17.5
* In sse.ts, pass transport.sessionId to startNotificationIntervals call
* In stdio.ts
  - destructure startNotificationIntervals from createServer call
  - implement custom logging request handler and server.sendLoggingMessage implementation, as a
  workaround for the fact that the SDK's automatic log level handling currently only tracks requested log level by session id. This will be fixed in a followup PR for the SDK
  - call the startNotificationIntervals function after connecting the transport to the server
* In streamableHttp.ts
  - destructure startNotificationIntervals from createServer call
  - call startNotificationIntervals passing the transport.sessionId after connecting the transport to the server
Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you for catching this!

@olaservo olaservo merged commit e322daf into modelcontextprotocol:main Sep 3, 2025
21 checks passed
@cliffhall
Copy link
Member Author

cliffhall commented Sep 3, 2025

I have a fix in in the queue on the SDK repo that will remove the need for our stdio server to do its own level handling. I'll refactor that out here as soon as we get that one merged and into a new SDK release, probably late next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants