modelcontextprotocol / modelcontextprotocol/typescript-sdk

Support `roots/list` request from server to client

Open
#1,167 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation enhancement fix proposed P2 ready for work
Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
4

Description

I have an MCP server build using the SDK. I need it to determine the workspace context of the client that is attempting to execute its tools. As I understand it, a roots/list request from the MCP server to the client is the mechanism defined in the MCP spec to do this. There seem to possibly be some APIs in the SDK for this, but they don't seem to be documented at all.

Things I've tried:

  1. Use the extra.sendRequest param while in a tool request handler
const result = await extra.sendRequest(
  { method: 'roots/list' } as const,
  ListRootsResultSchema
);
  1. Use the server.listRoots method (also in the request handler)
const result = await mcpServer.server.listRoots()

I've tried each with stateful and stateless versions of StreamableHTTPServerTransport construction. All attempts hang until eventually timing out.

If this is not yet supported, my request is:

Implement support for `roots/list` requests from server to client

If it is supported, and I'm just using incorrectly, my request is:

Document `roots/list` requests from server to client

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 tracing the tool request handler calls to extra.sendRequest and mcpServer.server.listRoots, then compare their behavior across stateful and stateless StreamableHTTPServerTransport construction. Check how the SDK handles server-to-client requests and the roots/list protocol flow. Done means roots/list works without timing out, or the supported usage and limitation are documented if implementation is out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.