Skip to main content

smolagents を aicharged.io に接続

215個のツール、1つのエンドポイント: https://aicharged.io/api/v1/mcp

smolagents

Hugging Face smolagents: streamable-http 経由の MCPClient。ドキュメントには headers キーの記載がありません。

  • API キー (Bearer)

クライアントのコード

推奨
import 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])

未確認: smolagents はこの dict を MCP SDK の streamablehttp_client に渡すため headers は動作するはずですが、ドキュメントにはこのキーの記載がありません。

パッケージをインストール

pip install "smolagents[mcp]"

またはCLIで自動設定する

aicharged setupは、このマシン上のAIクライアントを検出し、ブラウザ経由でサインインして、その設定を書き込みます。

1行で接続

CLIのインストール · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
CLIのインストール · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
MCPエンドポイント
https://aicharged.io/api/v1/mcp

ストリーミング可能なHTTP。ヘッダー Authorization: Bearer <API_KEY> を送信するか、クライアントが対応している場合はOAuthでサインインしてください。

またはエージェントに指示する
https://aicharged.io/agent.md を読んで、aicharged.io をセットアップしてください

このプロンプトで開く: Claude (新しいタブで開きます) ChatGPT (新しいタブで開きます) Perplexity (新しいタブで開きます)