> For the complete documentation index, see [llms.txt](https://docs.talordata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talordata.com/serp-api/integration/mcp-integration/llamaindex-integration.md).

# LlamaIndex Integration

Connect LlamaIndex agents to the TalorData MCP server to add real-time web search, scraping, and structured data retrieval to your RAG and indexing pipelines.

### Hosted MCP

{% stepper %}
{% step %}

#### Get your API token

* Go to [SERP API-API Token](https://dashboard.talordata.com/scraping/serp-api/api-token/) to create an API Token;
* Copy your API Token (format as: `sk_7qBRe***************************`）
  {% endstep %}

{% step %}

#### Install the LlamaIndex MCP toolkit

```
pip install llama-index-tools-mcp
```

{% endstep %}

{% step %}

#### Configure your MCP server

```
import asyncio
from llama_index.tools.mcp import BasicMCPClient

async def main():
    http_client = BasicMCPClient("https://mcp.talordata.com/API_TOKEN/mcp")

    # List tools
    tools = await http_client.list_tools()
    print("Tools:", tools)

    # Call a tool
    result = await http_client.call_tool("scrape_as_markdown", {"url":"https://docs.llamaindex.ai/en/stable/examples/tools/mcp/"})
    print("Result:", result)

asyncio.run(main())

```

{% endstep %}

{% step %}

#### Test to see if it works.&#xD;

* Run your LlamaIndex script using the manual tool.
* You should be able to see the requested URL in Markdown.

{% endstep %}

{% step %}

#### Monitor usage

View your API usage in the [TalorData SERP API usage logs](https://dashboard.talordata.com/scraping/serp-api/history).

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.talordata.com/serp-api/integration/mcp-integration/llamaindex-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
