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
- Create an API key in your MultitaskAI account.
- Install the SDK with pip install openai-agents.
- Connect with MCPServerStreamableHttp as below, with your key in place of YOUR_API_KEY, and pass the server to your agent in mcp_servers.
- 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 covers OpenAI Agents SDK's own settings in detail. See the overview for the endpoint and authentication, and pricing for the daily free requests.