Skip to content

Conversation

@tiginamaria
Copy link
Contributor

@tiginamaria tiginamaria commented Nov 7, 2025

Motivation and Context

Add ids for server sessions (auto generated when created)
Support methods proxying from server to server session by id

How Has This Been Tested?

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 Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Support requests proxying from server to session by id
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

A couple of suggestions. Overall good, but let's merge it after #378

Comment on lines +575 to +576
val session = getSessionOrThrow(sessionId)
return session.ping()
Copy link
Contributor

Choose a reason for hiding this comment

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

I see a pattern! It makes sense to make a method like withSession(sessionId) { session -> ... }

) : this(serverInfo, options, { instructions }, block)

private val sessions = atomic(persistentListOf<ServerSession>())
private val sessionRegistry = atomic(persistentMapOf<String, ServerSession>())
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's create a class for a session registry with a Type alias for the sessionId type. To better comply with the Single Responsibility Principle and potentially implement atomic operations on the session

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.

3 participants