-
Notifications
You must be signed in to change notification settings - Fork 10
Add MCP (Model Control Protocol) Client Support #84
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is awesome, and I'm super excited to use it in more of our apps!
Just 1 request – looks good to merge after that is changed!
defog/llm/utils_mcp.py
Outdated
print("All MCP server connections closed.") | ||
|
||
|
||
async def initialize_mcp_client(config_path, model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the first input param being a config_path, let's rename it config – where the type can either be dict or a string (filepath)
With this, calling this function from other apps becomes significantly more flexible. We can either pass a dict (which can be programmatically generated) to the function, or we can pass a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok done! Lemme know if this is ok!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Background
Model Context Protocol provides a standardized way for LLMs to use external tools. This PR adds support for connecting to MCP servers and letting models use tools working with both Anthropic, OpenAI and Gemini models.
Changes
How to Use MCPClient