Skip to content

Adding support for mutliple mcp server connections #8567

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

Conversation

anotherdish
Copy link

Langchain supports session management and connection to multiple mcp servers (see here), which is a nice feature to have. This PR is heavily inspired/is based on langchain's implementation of their MultiServerMCPClient

@chenmoneygithub
Copy link
Collaborator

@anotherdish Thanks for the PR! I am unsure if we want to rely on Langchain API to handle MCP inside DSPy. For multiple MCP connection, can we just run dspy_tools.append(dspy.Tool.from_mcp_tool(session, tool)) for each of them?

@anotherdish
Copy link
Author

@chenmoneygithub ya that makes sense. are we interested in having a class to handle the multiple mcp connections (like the MultiServerMCPClient class)? their implementation is nice for its support of automatically creating new client sessions if one doesn't already exist

@okhat okhat closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants