-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Feat/support mcp resources #1042
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 our terms of service and privacy 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?
Conversation
Thanks for sending this PR! Will check it later this week. |
Does this actually do anything to integrate MCP resources into the agent flow? Or is it up to the implementer to retrieve resources. Seems not very useful? Tool calls can return links to resources, it seems like it would be more useful to parse tool outputs and use the resource link to return a resource to the LLM. https://modelcontextprotocol.io/specification/2025-06-18/server/tools#resource-links |
Hey, thanks for the question!
|
Does anyone know if openai plans to support resource helper methods in open ai model calls? I experimented with something like this, which finds
|
Summary
Integrate MCP Resources. This allows MCP servers to expose data and content that can be read by clients and used as context for LLM interactions.
Key changes:
MCPServer
:list_resources
,list_resource_templates
andread_resource
_MCPServerWithClientSession
which is parent of classesMCPServerStdio
,MCPServerSse
, andMCPServerStreamableHttp
.Note: This PR does not implement
subscribe_resource
andunsubscribe_resource
methods.Test plan
Unit tests: Added 4 comprehensive tests in tests/mcp/test_resources_server.py covering:
Additionally, unit test
test_handoff_prompt_is_correct
has been added to increase coverage.Example verification: Created working example with MCP resources server and client
All tests pass: 527/527 tests passing after adding optional dependencies
Issue number
Partially addresses #544 (resources only)
Checks