Set up LlamaIndex
Data framework for LLM applications. Use llama-index-tools-mcp to connect Agentcy as a tool source in your LlamaIndex agents and workflows.
- 01
Sign up at app.goagentcy.com and create an API key
- 02
Install the package: pip install llama-index llama-index-tools-mcp
- 03
Create a BasicMCPClient with the Agentcy HTTP URL
- 04
Replace YOUR_AGENTCY_API_KEY with your actual key
- 05
Wrap it in a McpToolSpec and pass tools to any LlamaIndex agent
path: pip install llama-index-tools-mcp
# Python — LlamaIndex with MCP
# pip install llama-index llama-index-tools-mcp
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
mcp_client = BasicMCPClient(
url="https://data.goagentcy.com/mcp",
headers={"Authorization": "Bearer YOUR_AGENTCY_API_KEY"},
)
mcp_tool_spec = McpToolSpec(client=mcp_client)
# Get tools as LlamaIndex FunctionTools
tools = mcp_tool_spec.to_tool_list()
# Use with any LlamaIndex agent
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
agent = ReActAgent.from_tools(tools, llm=OpenAI("gpt-4o"))
response = agent.chat("How is my site performing?")LlamaIndex supports both consuming MCP servers (via llama-index-tools-mcp) and exposing LlamaIndex workflows as MCP servers. Supports stdio and Streamable HTTP transports. Works with any LlamaIndex-compatible LLM provider.
“Build a RAG system enriched with live marketing data”
“Query my GA4 data and combine it with document analysis”
“Create an agent that answers marketing questions from multiple sources”
“Analyze our content performance using Search Console data”