OpenAI introduced the Agents SDK in March, a framework for building multi-agent workflows. The SDK provides a way to define agent behaviour, connect to external tools, and manage the action flow. Recently, they have also extended the support for MCP. Tools are exposed through MCP (Model Context Protocol), a standard interface that lets agents discover and call functions from any compatible server.

This article explains how to use the OpenAI agents SDK to build agents and connect remote MCP servers from Composio.
What is OpenAI Agents SDK?
The OpenAI Agents SDK is a framework introduced by OpenAI in March 2025. It is built to help developers create agents that use large language models to solve tasks by thinking through goals and using tools. The SDK is open source and designed to be modular, so developers can customise agent behaviour as needed.
This SDK was released as part of Openai’s broader effort to support agent-based workflows.
The Agents SDK includes built-in support for agent memory, streaming output, tool retries, and tracing. It also supports function calling with structured inputs and outputs. These features allow developers to build reliable, debuggable, and suitable agents for real applications.
Agents built with the SDK can be used in local scripts, deployed as services, or integrated into product features.
Composio MCP
Composio MCP is a fully managed platform built on top of this standard. It offers access to over 100 tools, each exposed as an individual MCP server with built-in schemas, execution endpoints, and secure authentication. These tools are ready to be used by any agent who understands the MCP format.

Composio MCP Servers
Composio hosts and maintains these tools and handles all the complex parts of integration, OAuth flows, schema updates, version control, and monitoring. Developers don’t need to manually deal with external APIS, handle retries, or format payloads. This lets you focus purely on agent logic while working with consistent, reliable, and production-ready tools.
Why Use Composio MCP
Access 100+ MCP servers instantly: Tools are pre-integrated, MCP-compliant, and immediately available.
No API Wrapping Needed: Composio handles tool setup, input validation, response formatting, and error handling.
Secure by Default: Authentication, authorisation, and token handling are built in and fully managed.
Hosted, Versioned, and Monitored: Tools are kept up to date, performance-tracked, and ready for production use.
Designed for Agent Frameworks: Fully compatible with the OpenAI Agents SDK and other agent runtimes that support MCP.
🛠️ How to Build MCP Agents Using the OpenAI Agents SDK
An MCP agent is an AI agent that can use tools exposed through MCP-compliant servers. These tools follow a standard format, making them accessible to any compatible agent.
Using the OpenAI Agents SDK, you can register these servers manually and let the agent discover and use the tools at runtime. Below are the steps to build and run such an agent from scratch.
Step 1: Prepare Your Environment
You’ll need the following:
Python 3.8 or higher
An OpenAI API key
Step 2: Set Up Your Project
Create a virtual environment
macOS / Linux:
Windows:
Install required packages
Step 3: Add Your API Key
Create a .env file in your project root:
Load this in your script dotenv to authenticate with OpenAI.
Step 4: Connect Tools and Get MCP Server URLS
To make external tools accessible to your agent, you must set them up using the Composio CLI. This process creates MCP-compliant servers for each tool.
Step 4.1: Get Your MCP Server URL
Once your tool is connected:
Go to mcp.composio.dev
Navigate to the tool you want to connect to
Copy the MCP server URL (it will look like
https://mcp.composio.dev/<tool>/<instance-id>)
Step 5: Build and Run the Agent
Create a file called main.py and use the following structure:
Execution Examples: Using MCP Agents with Real Tools
The following examples show how to use the OpenAI Agents SDK to run MCP agents connected to real tools via Composio.
Before running these examples, make sure you’ve completed all the setup steps from the previous section:
Set up your environment and project
Retrieved the MCP server URL from mcp.composio.dev
You’ll use the MCP URLs directly in your agent code to link to specific tools like GitHub and Notion.
Example 1: Manage GitHub Repositories with an Agent
In this example, we use the OpenAI Agents SDK to build an agent that connects to GitHub through Composio’s MCP integration. The agent interprets natural language instructions and performs actions like creating issues in a repository.
Once the GitHub tool is connected and authenticated through Composio, this agent can:
🐞 Create GitHub issues based on user input
📌 Update repository descriptions or metadata
🔁 Assist with pull requests and dev workflows
⚙️ Automate project planning and bug tracking
The agent will create a new issue in a GitHub repository using a plain English task description in this example.
Make sure you have copied the MCP server URL from https://mcp.composio.dev/, as in step 4.3 (e.g. https://mcp.composio.dev/github/<your-tool-id>)
GitHub MCP Agent Code
Output
This is just one example of using an AI agent with GitHub. You could expand it to create milestones, assign tasks, or generate changelogs based on merged pull requests.
Example 2: Manage Notion Pages and Tasks with an Agent
In this example, we will build an agent that connects to Notion via Composio’s MCP integration. This agent can automate task planning, content creation, meeting notes, and more directly inside your Notion workspace.
Once the Notion tool is connected and authenticated through Composio, this agent can:
✍️ Create pages with titles, content, and custom layouts
✅ Add tasks or project outlines into a workspace
🧠 Automate status updates or team checklists
📅 Plan events, sprints, or meeting agendas
In this example, the agent will create a simple task planning page in Notion using a plain language command.
Make sure you have copied the MCP server URL from https://mcp.composio.dev/ like in step 4.3 (e.g. https://mcp.composio.dev/notion/<your-tool-id>)
Notion MCP Agent Code
Output
This example shows how easy it is to automate your planning and documentation inside Notion using a language-model-powered agent. You can expand it to add checkboxes, format content, or integrate with GitHub and Slack for full-team workflows.
Conclusion
With the OpenAI Agents SDK and Composio, you can build intelligent agents that understand tasks and use tools like GitHub, Notion, or Gmail to do real work.
Composio gives you ready-to-use tools, so you don’t need to worry about setting up APIs or handling complex code. You connect a tool, give your agent a task, and it takes care of the rest.