Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
MuhammadHassaanArain wants to merge5 commits intoopenai:main
base:main
Choose a base branch
Loading
fromMuhammadHassaanArain:feat/mcp-resources

Conversation

@MuhammadHassaanArain
Copy link
Contributor

Summary

Adds MCP Resources support (list, read, subscribe) to complete protocol implementation.

Changes

  • list_resources() - discover available resources
  • read_resource(uri) - read resource content
  • subscribe_resource(uri) - stream resource updates

Resources enable agents to access files, databases, and data streams per the MCP spec.

Details

  • Non-breaking change
  • Follows existing SDK patterns
  • Proper error handling and async/await
  • Delegates to ClientSession

Happy to add tests or docs if needed!

Copy link

@chatgpt-codex-connectorchatgpt-codex-connectorbot left a 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".

Comment on lines 79 to +83
[tool.uv.workspace]
members = ["agents"]
members = [
"agents",
"checking",
]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

P1 Badge Remove nonexistent workspace memberchecking

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 👍 / 👎.

Comment on lines 78 to 93
"""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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

P1 Badge 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 👍 / 👎.

@seratchseratch marked this pull request as draftNovember 10, 2025 03:52
@seratch
Copy link
Member

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chatgpt-codex-connectorchatgpt-codex-connector[bot]chatgpt-codex-connector[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@MuhammadHassaanArain@seratch

[8]ページ先頭

©2009-2025 Movatter.jp