Skip to content

Conversation

franciscovilchezv
Copy link
Contributor

This PR updates the documentation example for initializing MCPServerStreamableHTTP.

Previously, the example used a positional argument:

server = MCPServerStreamableHTTP('http://localhost:8000/mcp')  # (1)!

Updated to explicitly use the url keyword argument:

server = MCPServerStreamableHTTP(url='http://localhost:8000/mcp')  # (1)!

This change improves clarity, aligns with the current API, and avoids confusion for users referencing the docs.

@DouweM
Copy link
Collaborator

DouweM commented Sep 2, 2025

@franciscovilchezv Good catch! I think we were a little to aggressive in requiring all args to be kwargs. Can you instead update the class to move the * after url and leave the docs example as it was?

In MCPServerStdio, I think we can also move the * to be after command and args.

Edit: Did it myself :)

@DouweM DouweM changed the title Docs: update MCPServerStreamableHTTP usage example to use url argument Don't require MCPServerHTTP url to be a keyword argument Sep 3, 2025
@DouweM DouweM changed the title Don't require MCPServerHTTP url to be a keyword argument Don't require MCPServerStreamableHTTP and MCPServerSSE url to be a keyword argument Sep 3, 2025
@DouweM DouweM enabled auto-merge (squash) September 3, 2025 19:03
@DouweM DouweM merged commit 8149de4 into pydantic:main Sep 3, 2025
26 checks passed
@DouweM
Copy link
Collaborator

DouweM commented Sep 3, 2025

@franciscovilchezv Thanks Francisco!

@franciscovilchezv
Copy link
Contributor Author

Thanks @DouweM ! You are the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants