Skip to main content

Mastra を aicharged.io に接続

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

Mastra

Mastra: @mastra/mcp の MCPClient。キーは requestInit の headers に指定します。

  • API キー (Bearer)
  • OAuth でサインイン

クライアントのコード

推奨
import { MCPClient } from '@mastra/mcp';

const mcp = new MCPClient({
  servers: {
    aicharged: {
      url: new URL('https://aicharged.io/api/v1/mcp'),
      requestInit: { headers: { Authorization: `Bearer ${process.env.AICHARGED_API_KEY}` } },
    },
  },
});
const tools = await mcp.listTools();
console.log(Object.keys(tools));

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

npm install @mastra/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 (新しいタブで開きます)