feat: add remote streamable-http client example#2807
Open
twzrd-sol wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
examples/clients/remote_streamablehttp_client.py— a minimal, runnable example showing how to connect to a remote (hosted) MCP server using streamable-http transport.The existing
examples/servers/simple-streamablehttp/shows how to build a streamable-http server. This example shows the client side: connecting to an already-deployed remote server with no local setup required.Why this is useful
The streamable-http transport is the recommended transport for production/hosted MCP servers, but the SDK examples only show local server patterns. New SDK users frequently ask "how do I connect to a remote server?"—this answers that question with a single runnable file.
What the example uses
TWZRD Agent Intel (
https://intel.twzrd.xyz/mcp) — a live production MCP server with free tools, so the example works out-of-the-box without any API key or local server setup:score_agent(wallet)— returns a 0-100 trust score for a Web3 agent walletpreflight_check(wallet)— quick go/no-go check before making a paymentThe example:
streamablehttp_clientscore_agentandpreflight_checkInstall
No credentials needed — the free tools are public.
Test plan
pip install mcpin a fresh envpython examples/clients/remote_streamablehttp_client.pyruns without errorinitialize()