Skip to main content

Connect Python (MCP SDK) to aicharged.io

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

Python (MCP SDK)

The official Python MCP SDK (v1): a Streamable HTTP client with an Authorization header.

  • API key (Bearer)

Install the package

pip install "mcp<2"

Client code

Recommended
import asyncio, os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def main():
    headers = {"Authorization": f"Bearer {os.environ['AICHARGED_API_KEY']}"}
    async with streamablehttp_client("https://aicharged.io/api/v1/mcp", headers=headers) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools = await session.list_tools()
            print([tool.name for tool in tools.tools])
            print(await session.call_tool("list_runs", {}))

asyncio.run(main())

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)