Repository navigation
docs(mcp): teach authenticated Streamable HTTP - #9
Merged
Merged
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.
Module 11 shows a Streamable HTTP MCP connection with a key in the URL, but learners have no example for servers that require an
Authorization: Bearerheader. This adds an opt-in, provider-neutral Header example to the existingMultiServerMCPClientpath and explains Baizhi Cloud Agent Toolkit as one optional remote endpoint. The default AMap configuration is unchanged.The example reads the URL and token from the environment, rejects blank values and non-HTTPS remote URLs (loopback HTTP remains available for local testing), and keeps
.envfiles out of Git. I also corrected the module commands and the existing README's four-variableconfig.pyrequirement. A fresh install of the lockedlanggraph==1.0.5could resolvelanggraph-prebuilt==1.0.10, which failed to importToolNode; the matchinglanggraph-prebuilt==1.0.5pin fixes that observed combination.Validation:
git diff --checkand the repository's blocking flake8 selection pass. With Python 3.12 and the exact MCP/LangGraph versions above, a loopback synthetic MCP server verified that the Header reaches the server, missing/wrong tokens return 401, tools are discovered, and a tool call runs through LangGraphToolNode. This did not call a live Baizhi service or model. The full dependency tree on Python 3.10/3.11 and the complete course script remain for CI or a later integration check; the currentconfig.pystill requires four environment variables even if only the remote example is enabled.Disclosure: I am helping promote Baizhi Cloud Agent Toolkit. The public integration repository documents its Streamable HTTP endpoint and Bearer authentication; its hosted backend is not open source. Users supply their own API key, and some tool calls may consume paid service quota. This PR does not add a default vendor connection or imply upstream endorsement.