modelcontextprotocol / modelcontextprotocol/kotlin-sdk

roots StateFlow on session

Open
#586 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api enhancement P3 ready for work
Dominant language
Kotlin
Stars
1.5k
Forks
248
Avg merge
1d 20h
Merged PRs (30d)
23

Description

Is your feature request related to a problem? Please describe.

I would like to be able to get the current server roots without needing to send a request to the client every time. This is supported by the roots changed notification.

Describe the solution you'd like

For the server session object to have a roots: MutableStateFlow<PersistentSet<String>> property or similar, that it updates based on received roots notifications. Ideally it would list the roots when first collected.

Describe alternatives you've considered
Always listing the roots, which works but adds a bunch of overhead.

Additional context
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the server session object and the handling for received roots notifications. Trace how roots are currently requested and identify where a StateFlow could be exposed and initialized. Done means the session exposes current roots, updates them from notifications, and provides the initial roots when first collected without repeated requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.