Skip to main content

LangChain を aicharged.io に接続

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

LangChain

LangChain: langchain[mcp] が MCPAdapter を介して aicharged.io のツールを LangChain のツールに変換します。

  • API キー (Bearer)

クライアントのコード

推奨
import asyncio, os
from fastmcp import Client
from langchain.mcp import MCPAdapter

async def main():
    client = Client("https://aicharged.io/api/v1/mcp", auth=os.environ["AICHARGED_API_KEY"])
    async with MCPAdapter(client) as adapter:
        tools = await adapter.list_tools()
        print([tool.name for tool in tools])

asyncio.run(main())

旧 langchain-mcp-adapters パッケージはメンテナンスされていません。langchain[mcp] は FastMCP クライアントをベースにしています。

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

pip install "langchain[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 (新しいタブで開きます)