LlamaIndex
LlamaIndex: headers가 있는 BasicMCPClient를 쓰고, McpToolSpec이 도구를 LlamaIndex 도구로 변환합니다.
- API 키(Bearer)
- OAuth 로그인
클라이언트 코드
추천import asyncio, os
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
async def main():
client = BasicMCPClient("https://aicharged.io/api/v1/mcp", headers={"Authorization": f"Bearer {os.environ['AICHARGED_API_KEY']}"})
tools = await McpToolSpec(client=client).to_tool_list_async()
print([tool.metadata.name for tool in tools])
asyncio.run(main())
패키지 설치
pip install llama-index-tools-mcp