smolagents
smolagents od Hugging Face: MCPClient přes streamable-http; klíč headers jeho dokumentace neuvádí.
- API klíč (Bearer)
Kód klienta (client)
Doporučenoimport 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])
Neověřeno: smolagents předá tento slovník (dict) do streamablehttp_client z MCP SDK, takže headers by měly fungovat, jeho dokumentace ale klíč neuvádí.
Instalace balíčku (install)
pip install "smolagents[mcp]"