LlamaIndex
LlamaIndex: ஹெடர்களுடன் 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