# Connect the MultitaskAI MCP server to OpenAI Agents SDK

The OpenAI Agents SDK for Python connects agents to MCP servers. Connect MultitaskAI with MCPServerStreamableHttp and pass it in mcp_servers.

## Endpoint

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

## Steps

1. Create an API key in your MultitaskAI account.
2. Install the SDK with pip install openai-agents.
3. Connect with MCPServerStreamableHttp as below, with your key in place of YOUR_API_KEY, and pass the server to your agent in mcp_servers.
4. Run the script and check that the agent answers with MultitaskAI tools.

```python
import asyncio

from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp


async def main() -> None:
    async with MCPServerStreamableHttp(
        name="multitaskai",
        params={
            "url": "https://mcp.multitaskai.com",
            "headers": {"Authorization": "Bearer YOUR_API_KEY"},
        },
        cache_tools_list=True,
    ) as server:
        agent = Agent(name="Assistant", mcp_servers=[server])
        result = await Runner.run(agent, "List my MultitaskAI tools.")
        print(result.final_output)


asyncio.run(main())
```

## Authentication

OpenAI Agents SDK 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

- This runs the MCP client in your own process.
- HostedMCPTool hands the connection to the Responses API instead, which needs the endpoint reachable from OpenAI.
- For TypeScript, see the OpenAI Agents SDK for TypeScript guide.

## Official documentation

The [OpenAI MCP documentation](https://openai.github.io/openai-agents-python/mcp/) covers OpenAI Agents SDK's own settings in detail. See the [overview](/docs.md) for the endpoint and authentication, and [pricing](/pricing/) for the daily free requests.
