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]"