smolagents
Hugging Face smolagents: MCPClient przez streamable-http; jego dokumentacja nie pokazuje klucza headers.
- Klucz API (Bearer)
Kod klienta
Zalecaneimport 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])
Niezweryfikowane: smolagents przekazuje ten dict do streamablehttp_client z MCP SDK, więc headers powinno działać, ale dokumentacja nie pokazuje tego klucza.
Zainstaluj pakiet
pip install "smolagents[mcp]"