Skip to content

add auth client sse #760

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 2 commits into from
May 20, 2025
Merged

add auth client sse #760

merged 2 commits into from
May 20, 2025

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented May 20, 2025

Similar to Streamable Http Auth client added in #751 adding auth to SSE.

Testing
SSE

uv run mcp-simple-auth --transport sse

MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client

Check that StreamableHttp works:

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

@ihrpr ihrpr requested a review from pcarleton May 20, 2025 11:45
pcarleton
pcarleton previously approved these changes May 20, 2025
Copy link
Contributor

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

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

LGTM

Tested against the python example:

uv run mcp-simple-auth --transport sse

MCP_SERVER_URL=http://localhost:8000/sse MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client

@@ -327,12 +339,14 @@ async def main():
# Default server URL - can be overridden with environment variable
# Most MCP streamable HTTP servers use /mcp as the endpoint
server_url = os.getenv("MCP_SERVER_URL", "http://localhost:8000/mcp")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might change this to be /sse if the transport is set since that's the default binding we get. might get a little funky making sure you don't overwrite it though.

https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/fastmcp/server.py#L93

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, something is weird, I thought I changed that to port!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't push it 😞

@ihrpr ihrpr merged commit 43ded92 into main May 20, 2025
12 of 13 checks passed
@ihrpr ihrpr deleted the ihrpr/auth-client-sse branch May 20, 2025 14:21
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