Skip to content

[FEATURE]: Add DSPy ReAct support on MCP #21

@auschoi96

Description

@auschoi96

Is there an existing issue for this?

  • I have searched the existing issues

Problem statement

Similar to this request in the DSPy framework, I'd like to incorporate the same in this MCP framework: stanfordnlp/dspy#8128 and stanfordnlp/dspy#8060

Need to make utils to transform MCP Tools to dspy.Tools and enable compatibility with DSPy ReAct. The forward method should also be updated to support asynchronous and synchronous tools from MCP. Since we are focused on UC tools in this case, need to do the same and make it compatible with dspy.Tools

Proposed Solution

From Omar in the DSPy repo:

This is a list of proposals that this PR should adhere to

  1. We should provide a public util to convert mcp.types.Tool and mcp.client.session.ClientSession into dspy.primitives.tool.Tool so that MCP tools can be passed to dspy.ReAct
  2. We should update dspy.ReAct sot i can use async callables and async Tools in the sync forward method. While we plan to provide an async forward method, it should be a follow-up after the MVP version (not this PR).
  3. We don't plan to support MCP server session management within the DSPy library in the short term. We believe it should be addressed by the MCP library side.
  4. Add support for UC tooling

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions