smolagents
Hugging Face smolagents: MCPClient over streamable-http; its docs do not show the headers key.
- API key (Bearer)
Client code
Recommendedimport os
from smolagents import MCPClient
server = {
"url": "https://aicharged.io/api/v1/mcp",
"transport": "streamable-http",
"headers": {"Authorization": f"Bearer {os.environ['AICHARGED_API_KEY']}"},
}
with MCPClient(server) as tools:
print([tool.name for tool in tools])
Unverified: smolagents passes this dict to the streamablehttp_client of the MCP SDK, so headers should work, but its docs do not show the key.
Install the package
pip install "smolagents[mcp]"