Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why:
Adds MCPTool (Model Context Protocol), enabling tools to connect and interact with MCP servers via HTTP and stdio transports.
What:
mcp_tool
that includes classes to handle the MCP client implementation for HTTP and stdio transports.__init__.py
to export MCP-related classes for external use.pyproject.toml
.How can it be used:
MCP tools can be created and invoked through HTTP or stdio server configurations:
How did you test it:
Implemented unit tests using
pytest
andunittest.mock
to simulate MCP server behaviors. Additionally, integration tests were conducted with actual server instances to validate interactions across network protocols.Notes for the reviewer:
Focus on the implementation details of the
MCPTool
class inmcp_tool.py
, and ensure tests effectively mock server responses and include proper cleanup routines. Check integration with the new MCP server dependencies inpyproject.toml
.