Skip to main content

Kết nối smolagents với aicharged.io

215 công cụ, một endpoint: https://aicharged.io/api/v1/mcp

smolagents

Hugging Face smolagents: MCPClient qua streamable-http; tài liệu của nó không nêu trường headers.

  • Khóa API (Bearer)

Mã client

Khuyên dùng
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])

Chưa xác minh: smolagents truyền dict này cho streamablehttp_client của MCP SDK, nên headers hẳn sẽ hoạt động, nhưng tài liệu của nó không nêu trường này.

Cài đặt gói

pip install "smolagents[mcp]"

Hoặc để CLI tự động thiết lập

`aicharged setup` tìm kiếm các client AI trên máy này, đăng nhập cho bạn qua trình duyệt và ghi cấu hình của chúng.

Kết nối chỉ với một dòng lệnh

Cài đặt CLI · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
Cài đặt CLI · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
Endpoint MCP
https://aicharged.io/api/v1/mcp

HTTP dạng stream. Gửi header Authorization: Bearer <API_KEY>, hoặc đăng nhập bằng OAuth nếu client của bạn hỗ trợ.

Hoặc yêu cầu agent của bạn
Hãy đọc https://aicharged.io/agent.md và thiết lập aicharged.io cho tôi

Mở bằng prompt này trong Claude (mở trong tab mới) ChatGPT (mở trong tab mới) Perplexity (mở trong tab mới)