AgentcyAlpha
Integrations/LlamaIndex

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.

SETUP
5 STEPS
  1. 01

    Sign up at app.goagentcy.com and create an API key

  2. 02

    Install the package: pip install llama-index llama-index-tools-mcp

  3. 03

    Create a BasicMCPClient with the Agentcy HTTP URL

  4. 04

    Replace YOUR_AGENTCY_API_KEY with your actual key

  5. 05

    Wrap it in a McpToolSpec and pass tools to any LlamaIndex agent

CONFIG

path: pip install llama-index-tools-mcp

python
# 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?")
Last verified: March 5, 2026Official docs
TIPS

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.

EXAMPLE QUERIES
4 SAMPLES

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

v1.0Need help?