- Explore MCP Servers
- mcp-sse-demo
Mcp Sse Demo
What is Mcp Sse Demo
mcp-sse-demo is a demonstration project that utilizes the Model Context Protocol (MCP) with Server-Sent Events (SSE) to interact with a Zapier MCP server, enabling an AI agent to access Gmail functionalities.
Use cases
Use cases include automating email searches, managing Gmail tasks via a conversational interface, and enhancing user interactions with email through AI.
How to use
To use mcp-sse-demo, clone the repository, set up a virtual environment, install the required dependencies, create a .env file with your credentials, and enable the desired Zapier actions. You can then use the async chat function provided in chat.py to interact with the AI agent.
Key features
Key features include the ability to connect to the Zapier MCP server, manage Gmail actions through an AI agent, and utilize an OpenAI model for understanding and executing user requests.
Where to use
mcp-sse-demo can be used in applications that require integration with Gmail functionalities, particularly in automated workflows and AI-driven chatbots.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Sse Demo
mcp-sse-demo is a demonstration project that utilizes the Model Context Protocol (MCP) with Server-Sent Events (SSE) to interact with a Zapier MCP server, enabling an AI agent to access Gmail functionalities.
Use cases
Use cases include automating email searches, managing Gmail tasks via a conversational interface, and enhancing user interactions with email through AI.
How to use
To use mcp-sse-demo, clone the repository, set up a virtual environment, install the required dependencies, create a .env file with your credentials, and enable the desired Zapier actions. You can then use the async chat function provided in chat.py to interact with the AI agent.
Key features
Key features include the ability to connect to the Zapier MCP server, manage Gmail actions through an AI agent, and utilize an OpenAI model for understanding and executing user requests.
Where to use
mcp-sse-demo can be used in applications that require integration with Gmail functionalities, particularly in automated workflows and AI-driven chatbots.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP SSE Demo
This repository demonstrates using the Model Context Protocol (MCP) with Server-Sent Events (SSE) to interact with a Zapier MCP server, enabling access to Gmail functionalities through an AI agent.
It illustrates integrating a remotely hosted MCP server with your LLM of choice (i.e. not via the Claude desktop app or Cursor)
Update: SSE is being deprecated in favor of Stremable HTTP. I’ve added an example using this via FastMCP. Notebook here
Overview
The project uses an OpenAI model (gpt-4o-mini) to understand user requests, determine if a Gmail action (tool) is needed, and execute it via the Zapier MCP server.
Key Files
mcp_clients/zapier_mcp_client.py: Contains theGmailMCPClientclass responsible for connecting to the Zapier MCP server over SSE, listing available tools, and managing the connection.chat.py: The chat application logic. It initializes theGmailMCPClient, connects to the Zapier server, retrieves tools, execute the tool call and pass the tool output to the LLM for synthesis. (i.e. the familiar function calling pattern)
Prerequisites
- Python 3.8+
- OpenAI API key
- Zapier account with MCP access
Setup
-
Clone the repository:
git clone <your-repo-url> cd <your-repo-directory> -
Create a virtual environment and install dependencies:
python -m venv .venv source .venv/bin/activate pip install openai python-dotenv mcp nest_asyncio fastmcp -
Create a
.envfile:touch .env -
Add your credentials to the
.envfile:OPENAI_API_KEY="sk-proj-..." ZAPIER_URL="https://actions.zapier.com/mcp/YOUR_SECRET_KEY/sse" ZAPIER_URL_FASTMCP="https://mcp.zapier.com/api/mcp/s/your-secret-key/mcp" -
Enable the Zapier actions you want to call as tools
via https://actions.zapier.com/settings/mcp/
This demo uses
Gmail: Find Email
Usage
The chat.py script provides an async chat(user_input) function. You can import and use this function in your own script or an interactive environment i.e. Jupyter notebook to interact with the chatbot.
Example in a Python script):
import asyncio
from chat import chat
async def main():
user_query = "Check my latest email."
response = await chat(user_query)
print(response)
if __name__ == "__main__":
asyncio.run(main())
Example in Jupyter notebook

Example using the FastMCP framework (tool discovery and invocation)

Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










