Skip to content

Fix connection issue for servers with auth #418

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

Merged
merged 6 commits into from
May 21, 2025
Merged

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented May 19, 2025

There are multiple reports on bot being able to connect to SSE and Streamable Http with Auth:

modelcontextprotocol/python-sdk#731
#390
modelcontextprotocol/python-sdk#679

SSE: due to auth provider - described here

Streamable Http - Auth flow was working fine, but when just clicking on connect, the request was hanging and then just timing out, instead of caching Auth error and re-triggering auth. The issue was that proxy was just masking errors and not returning them back to the client to be correctly handled during initialization. Unlike SSE, streamable Http does the first request on Initialization phase.


cd python-sdk/examples/servers/simple-auth 

uv run mcp-simple-auth --transport streamable-http

 uv run mcp-simple-auth --transport sse    

Testing:
Streamable Http Test:
image
SSE
image

@@ -82,7 +82,7 @@ const ToolsTab = ({
<span className="text-green-600 font-semibold">Success</span>
)}
</h4>
{structuredResult.content.map((item, index) => (
{structuredResult.content?.map((item, index) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unrelated, build was not happy

Copy link
Member

Choose a reason for hiding this comment

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

That's interesting, that seems to indicate that content became an optional field since the last time we touched the ToolsTab?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, I think I know what's going on, we recently released tool structured output and we probably imported the new version of the TS SDK -- surprised now that CI didn't complain before ...

@bhosmer-ant would be good to add it to the inspector for testing as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, mystery solved! thank you @bhosmer-ant!!

I used local version of typescript sdk hence had this error, removed it

Copy link
Member

Choose a reason for hiding this comment

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

Just leaving this thread open as a placeholder for the incoming SDK change mentioned elsewhere.

@ihrpr ihrpr requested review from pcarleton, cliffhall and olaservo May 20, 2025 07:28
olaservo
olaservo previously approved these changes May 20, 2025
@@ -234,7 +234,6 @@ const App = () => {
const onOAuthConnect = useCallback(
(serverUrl: string) => {
setSseUrl(serverUrl);
setTransportType("sse");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is transport type no longer set here?

@ihrpr ihrpr merged commit eda63da into main May 21, 2025
7 of 9 checks passed
@ihrpr ihrpr deleted the ihrpr/auth-sse-shttp-connect branch May 21, 2025 19:26
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.

4 participants