LangChain
LangChain: langchain[mcp] превращает инструменты aicharged.io в инструменты LangChain через MCPAdapter.
- 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]"