Skip to content

Add Roots support to the MCP client and server #2895

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gspencergoog
Copy link

@gspencergoog gspencergoog commented May 9, 2025

Description

This adds roots support to the MCP client and server. It supports setting client roots when creating the client, but not modifying the roots once the client plugin is created. That will have to come later: changing the roots means that the available tools/prompts/resources might also change, and I didn't want to build dynamically changing tools because I wasn't clear on exactly how that was done. I did add support for the server to request the roots from the client (because some do that even if the roots don't change), which means that the client now registers handlers too.

Tests

  • I also added some basic configuration unit tests for the client and server (Despite being verbose, they don't actually test that much, just the setup).

@gspencergoog
Copy link
Author

@mbleigh Here is the roots support PR I said I'd send your way. Let me know if it's what you were expecting.

I've tested the client against a server that supports roots, and it seems to work as expected. It should probably have some integration tests too, so that the client (and server) would be tested against a fake server (and client).

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant