-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix MCP server mounted path #11231
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
Fix MCP server mounted path #11231
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/a78ef0fbfaaced256c955afe546962765f724cc5/gradio-5.30.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@a78ef0fbfaaced256c955afe546962765f724cc5#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/a78ef0fbfaaced256c955afe546962765f724cc5/gradio-client-1.15.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/a78ef0fbfaaced256c955afe546962765f724cc5/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
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.
Changes look good to me @abidlabs !
@@ -157,6 +157,7 @@ async def handle_sse(request): | |||
streams[1], | |||
self.mcp_server.create_initialization_options(), | |||
) | |||
return Response() |
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.
Why do we need this? Is it possible to even reach this part of the code? The with block seems like it would block forever
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.
Yeah so I added it because I would see an exception being raised (None type is not callable or something like that) when a client would disconnect from the mcp server. So while it doesn't functionally change anything, it prevents this exception from being raised during disconnect
mcp==1.9.0
introduced a breaking change in how paths are mounted (the new approach is actually the correct one, see modelcontextprotocol/python-sdk#659)This PR makes the corresponding change in Gradio's MCP server to account for this change and adds a test.
Closes: #11225
Closes: #11219