Skip to content

[MINOR] Handle multiple responses are returned from MCP - #69

Merged
grll merged 6 commits into
grll:mainfrom
navinpai:navin/multiple_response
Sep 17, 2025
Merged

[MINOR] Handle multiple responses are returned from MCP#69
grll merged 6 commits into
grll:mainfrom
navinpai:navin/multiple_response

Conversation

@navinpai

@navinpai navinpai commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

When MCP server returns multiple returns (especially in streamable-http MCP servers), mcpadapt CrewAIAdaper only returns the first response. This minor PR collates all the responses text into a list and returns the entire response to CrewAI so it can use the entire response.

Tested with crewai==0.165.1

Note: This issue was also reported in #55

@navinpai

navinpai commented Sep 6, 2025

Copy link
Copy Markdown
Contributor Author

@grll can you please take a look at this? 🙏

@grll

grll commented Sep 6, 2025

Copy link
Copy Markdown
Owner

@grll can you please take a look at this? 🙏

Hey thanks a lot for the contribution. Sorry for the delay I will try to review ASAP

@grll grll left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go for the backward compatible change then, this would mean we can revert the test and just add a new test to check that multiple value get a string representation of the list with all the values.

Also if you feel like it you could add a warning similar to smolagents adapter about the the fact that we only support text.

Comment thread src/mcpadapt/crewai_adapter.py
@navinpai
navinpai requested a review from grll September 15, 2025 20:54

@grll grll left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good thank you for making the change. I would just remove the single content test as I think it is anyway already tested above that case. Then we should be good to merge. Thanks again!

Comment thread tests/test_crewai_adapter.py Outdated
Comment thread tests/test_crewai_adapter.py Outdated
@navinpai
navinpai requested a review from grll September 16, 2025 13:40
@grll
grll merged commit 76c3833 into grll:main Sep 17, 2025
@grll

grll commented Sep 17, 2025

Copy link
Copy Markdown
Owner

@navinpai thank you for the change! Merged and released in v0.1.15

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.

2 participants