Skip to content

Support roots/list request from server to client #1167

@bmingles

Description

@bmingles

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequest for a new feature that's not currently supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions