MCP ExplorerExplorer

Openai Composio Mcp Example

@ComposioHQon 10 months ago
1 MIT
FreeCommunity
AI Systems
An OpenAI agent example using Composio MCP for email summarization.

Overview

What is Openai Composio Mcp Example

openai-composio-mcp-example is a demonstration project that utilizes the OpenAI Agents SDK in conjunction with Composio MCP to create an agent capable of interacting with email services, specifically designed for summarizing emails.

Use cases

Use cases include automating email summaries for busy professionals, enhancing customer support by summarizing client emails, and integrating with other applications to provide insights from email communications.

How to use

To use openai-composio-mcp-example, install the ‘uv’ package for Python dependency management, create a virtual environment, install the required dependencies, set up your OpenAI API key and MCP server URL in a .env file, and run the agent using the command ‘uv run agent.py’.

Key features

Key features include integration with OpenAI’s GPT-4 model, the ability to connect to Composio MCP Server, and functionality to list and summarize recent emails.

Where to use

openai-composio-mcp-example can be used in fields such as email management, customer support, and any application requiring email summarization and analysis.

Content

OpenAI Agent with MCP

This is a simple example of using OpenAI Agents SDK with Composio MCP, using uv for Python dependency management.

Setup

  1. Install uv:
pip install uv
  1. Create and activate a virtual environment with uv:
uv venv
  1. Install Python dependencies with uv:
uv pip install -r requirements.txt
  1. Create a .env file 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)

Usage

Run the agent:

uv run agent.py

The agent will:

  1. Connect to the Composio MCP Server
  2. Ask to fetch all the emails and summarise them

How it works

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

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers