This is a simple example of using OpenAI Agents SDK with Composio MCP, using uv for Python dependency management.
- Install uv:
pip install uv- Create and activate a virtual environment with uv:
uv venv- Install Python dependencies with uv:
uv pip install -r requirements.txt- Create a
.envfile and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
COMPSOIO_MCP_SSE_URL=<YOUR_MCP_SERVER>Get the MCP URL from https://mcp.composio.dev (this example is for Gmail MCP server)
Run the agent:
uv run agent.pyThe agent will:
- Connect to the Composio MCP Server
- Ask to fetch all the emails and summarise them
The agent uses the OpenAI Agents SDK with MCP integration to:
- Initialize an OpenAI model (GPT-4)
- Create an agent to Composio MCP Server with the SSE Link
- List and summarise all the recent emails