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