Skip to main content

将 AutoGen 连接到 aicharged.io

215 个工具,一个端点:https://aicharged.io/api/v1/mcp

AutoGen

AutoGen:带 headers 的 StreamableHttpServerParams,通过 McpWorkbench 使用。

  • API 密钥(Bearer)

客户端代码

推荐
import asyncio, os
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

async def main():
    params = StreamableHttpServerParams(
        url="https://aicharged.io/api/v1/mcp",
        headers={"Authorization": f"Bearer {os.environ['AICHARGED_API_KEY']}"},
        timeout=30.0,
    )
    async with McpWorkbench(params) as workbench:
        tools = await workbench.list_tools()
        print([tool["name"] for tool in tools])

asyncio.run(main())

安装软件包

pip install "autogen-ext[mcp]"

或者让 CLI 自动设置

aicharged setup 会自动查找此电脑上的 AI 客户端,通过浏览器引导您登录,并写入相应的配置。

一行命令,轻松连接

安装 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 (在新标签页中打开)