Skip to main content

TypeScript (MCP SDK) verbinden met aicharged.io

215 tools, één endpoint: https://aicharged.io/api/v1/mcp

TypeScript (MCP SDK)

De officiële TypeScript MCP SDK (2.3.0 of nieuwer) met de StreamableHTTPClientTransport.

  • API-sleutel (Bearer)

Installeer het pakket

npm install @modelcontextprotocol/client@^2.3.0

Gebruik 2.3.0 of nieuwer (beveiligingsfix voor headers die bij redirects opnieuw worden verstuurd).

Clientcode

Aanbevolen
import { Client, StreamableHTTPClientTransport } from '@modelcontextprotocol/client';

const client = new Client({ name: 'my-app', version: '1.0.0' });
await client.connect(new StreamableHTTPClientTransport(new URL('https://aicharged.io/api/v1/mcp'), {
  requestInit: { headers: { Authorization: `Bearer ${process.env.AICHARGED_API_KEY}` } },
}));
const { tools } = await client.listTools();
console.log(tools.map((tool) => tool.name));
console.log(await client.callTool({ name: 'list_runs', arguments: {} }));

Of laat de CLI het instellen

aicharged setup vindt de AI-clients op deze machine, logt je in via de browser en schrijft hun configuratie.

Verbind in één regel

Installeer de CLI · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
Installeer de CLI · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
MCP-endpoint
https://aicharged.io/api/v1/mcp

Streamable HTTP. Stuur de header Authorization: Bearer <API_KEY> mee, of log in met OAuth als je client dat ondersteunt.

Of zeg het je agent
Lees https://aicharged.io/agent.md en stel aicharged.io voor me in

Openen met deze prompt in Claude (opent in een nieuw tabblad) ChatGPT (opent in een nieuw tabblad) Perplexity (opent in een nieuw tabblad)