# Connect the MultitaskAI MCP server to LlamaIndex

LlamaIndex agents load MCP tools through llama-index-tools-mcp. Connect MultitaskAI with a BasicMCPClient and McpToolSpec, then pass the tools to your agent.

## Endpoint

```text
https://mcp.multitaskai.com
```

## Steps

1. Create an API key in your MultitaskAI account.
2. Install the MCP tools package with pip install llama-index-tools-mcp.
3. Create the client below, with your key in place of YOUR_API_KEY, and pass the tools to your FunctionAgent.
4. Run the agent and ask which MultitaskAI tools it can use.

```python
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

mcp_client = BasicMCPClient(
    "https://mcp.multitaskai.com",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
mcp_tool_spec = McpToolSpec(client=mcp_client)
tools = await mcp_tool_spec.to_tool_list_async()
```

## Authentication

LlamaIndex sends your MultitaskAI API key in the Authorization header. Create a key in your account and use it in place of YOUR_API_KEY. Keep the key out of files you share or commit.

```text
Authorization: Bearer YOUR_API_KEY
```

## Good to know

- An https URL is treated as Streamable HTTP unless it is an SSE endpoint.
- If you pass your own http_client, the headers and timeout parameters are ignored, so set the Authorization header on that client.
- Pass the tools with FunctionAgent(tools=tools, llm=...).

## Official documentation

The [LlamaIndex MCP documentation](https://developers.llamaindex.ai/python/framework/module_guides/mcp/llamaindex_mcp/) covers LlamaIndex's own settings in detail. See the [overview](/docs.md) for the endpoint and authentication, and [pricing](/pricing/) for the daily free requests.
