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
- Create an API key in your MultitaskAI account.
- Install the MCP tools package with pip install llama-index-tools-mcp.
- Create the client below, with your key in place of YOUR_API_KEY, and pass the tools to your FunctionAgent.
- 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 covers LlamaIndex's own settings in detail. See the overview for the endpoint and authentication, and pricing for the daily free requests.