Skip to main content

Kết nối Vercel AI SDK với aicharged.io

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

Vercel AI SDK

Vercel AI SDK: createMCPClient từ @ai-sdk/mcp với HTTP transport; truyền thẳng các công cụ cho generateText hoặc streamText.

  • Khóa API (Bearer)
  • Đăng nhập bằng OAuth

Mã client

Khuyên dùng
import { createMCPClient } from '@ai-sdk/mcp';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://aicharged.io/api/v1/mcp',
    headers: { Authorization: `Bearer ${process.env.AICHARGED_API_KEY}` },
  },
});
const tools = await client.tools(); // pass to generateText / streamText
console.log(Object.keys(tools));
await client.close();

Cài đặt gói

npm install ai @ai-sdk/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)