- Notifications
You must be signed in to change notification settings - Fork2.8k
feat: add MCP Resources support#2060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
feat: add MCP Resources support#2060
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When yousign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| [tool.uv.workspace] | ||
| members = ["agents"] | ||
| members = [ | ||
| "agents", | ||
| "checking", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Remove nonexistent workspace member
checking
Adding"checking" totool.uv.workspace.members introduces a build-time failure because the repository contains nochecking/ package. Runninguv ormake commands now causes uv to error with “No such workspace member ‘checking’”, preventing dependency installs or packaging. This looks unrelated to the MCP resources feature and should be reverted or the directory added.
Useful? React with 👍 / 👎.
| """Invoke a tool on the server.""" | ||
| pass | ||
| @abc.abstractmethod | ||
| asyncdeflist_resources(self)->ListResourcesResult: | ||
| """List resources available on the server.""" | ||
| pass | ||
| @abc.abstractmethod | ||
| asyncdefread_resource(self,uri:str)->ReadResourceResult: | ||
| """Read the content of a resource by URI.""" | ||
| pass | ||
| @abc.abstractmethod | ||
| asyncdefsubscribe_resource(self,uri:str,**kwargs)->AsyncIterator[SessionMessage]: | ||
| """Subscribe to resource updates.""" | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
New abstract resource methods break existing MCPServer subclasses
Introducinglist_resources,read_resource, andsubscribe_resource as abstract methods onMCPServer means every existing subclass must implement them. Classes liketests/mcp/test_prompt_server.FakeMCPPromptServer (and any user-defined servers) still lack these methods, so instantiating them now raisesTypeError: Can't instantiate abstract class … and the current test suite will fail. Consider providing default implementations or updating all subclasses.
Useful? React with 👍 / 👎.
seratch commentedNov 10, 2025
Thanks for sending this patch. However, we don't plan to add these methods for now because the core part of this SDK does not use MCP resources at all. |
Summary
Adds MCP Resources support (list, read, subscribe) to complete protocol implementation.
Changes
list_resources()- discover available resourcesread_resource(uri)- read resource contentsubscribe_resource(uri)- stream resource updatesResources enable agents to access files, databases, and data streams per the MCP spec.
Details
Happy to add tests or docs if needed!