Skip to main content

Connect TypeScript (MCP SDK) to aicharged.io

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

TypeScript (MCP SDK)

The official TypeScript MCP SDK (2.3.0 or newer) with the StreamableHTTPClientTransport.

  • API key (Bearer)

Install the package

npm install @modelcontextprotocol/client@^2.3.0

Use 2.3.0 or newer (security fix for headers re-sent on redirects).

Client code

Recommended
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: {} }));

Or let the CLI set it up

aicharged setup finds the AI clients on this machine, signs you in through the browser and writes their configuration.

Connect in one line

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

Streamable HTTP. Send the header Authorization: Bearer <API_KEY>, or sign in with OAuth where your client supports it.

Or tell your agent
Read https://aicharged.io/agent.md and set me up with aicharged.io

Open with this prompt in Claude (opens in a new tab) ChatGPT (opens in a new tab) Perplexity (opens in a new tab)