Use APIStack tools in the OpenAI Agents SDK (Python and TypeScript)

The Agents SDK connects to remote MCP servers over Streamable HTTP. Add APIStack once and your agent can look up and call any API in the catalog.

Prefer video? · 1:34

Give your AI agent 100+ tools with one MCP URL

Connect APIStack to Claude Code, Cursor, VS Code or your own agent, with a real agent run.

Set it up

pip install openai-agents    # or: npm install @openai/agents

Create a free APIStack account and set your key as APISTACK_API_KEY.

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


async def main():
    async with MCPServerStreamableHttp(
        name="APIStack",
        params={
            "url": "https://apistack.online/api/mcp/connect",
            "headers": {"x-api-key": os.environ["APISTACK_API_KEY"]},
        },
        cache_tools_list=True,
    ) as apistack:
        agent = Agent(
            name="Ops assistant",
            model="gpt-5-mini",
            instructions="Use APIStack tools to check facts instead of guessing.",
            mcp_servers=[apistack],
        )
        result = await Runner.run(agent, "When does the SSL certificate for github.com expire, and who issued it?")
        print(result.final_output)


asyncio.run(main())

Output from a real run (openai-agents 0.22 (Python), @openai/agents 0.18 (TypeScript), gpt-5-mini):

# Python
The certificate expires on 2026-11-29 at 23:59:59 UTC. It was issued by Sectigo Limited (CN: Sectigo Public Server Authentication CA DV E36).

# TypeScript
Monthly payment: $2,212.24
Total interest paid (over 30 years): $446,405.71

No SDK? Use the Responses API directly

OpenAI can call the MCP server for you. See the Responses API guide for a single-request version with no agent framework.

Cache the tool list

cache_tools_list (cacheToolsList in TypeScript) avoids a tools/list round trip on every run. The default toolset is three tools, so it's small either way.

Related guides