---
title: 'AI Agents with Zapier MCP: One Server, Any Model'
source: 'https://youtube.com/watch?v=eP1SY86QmrI'
video_id: 'eP1SY86QmrI'
date: 2026-07-31
duration_sec: 1368
---

# AI Agents with Zapier MCP: One Server, Any Model

> Source: [AI Agents with Zapier MCP: One Server, Any Model](https://youtube.com/watch?v=eP1SY86QmrI)

## Summary

The video demonstrates how to build an AI agent that summarizes a user's day from Gmail, Slack, and Google Calendar, with the ability to switch between GPT, Gemini, and Claude by changing a single line of code. The creator emphasizes avoiding vendor lock-in by building on open protocols like MCP and using Zapier's MCP server for integration. A full Python code walkthrough is provided, including setup, custom client logic, and model switching.

### Key Points

- **Morning Brief Agent Concept** [00:02] — The creator built an AI agent that pulls calendar, email, and Slack data to give a 30-second morning brief. With one line of code, the model can be switched between GPT, Gemini, and Claude.
- **Two Horror Stories** [01:14] — Story 1: GPT-5 users discovered requests were routed to a cheaper variant under load. Story 2: Anthropic silently degraded the Claude coding harness without announcement. Lesson: tools can stop working overnight without notice.
- **Vendor Lock-in is Dependency** [02:14] — If you are locked into a single model provider, you have a dependency, not a business. Agility and the ability to switch providers are essential.
- **LangChain Bloats Code** [02:41] — LangChain requires excessive code to integrate one tool (e.g., Google Calendar) and managing credentials/tokens becomes a nightmare. With 500 tools, this approach is impractical.
- **Claude Desktop Connectors Are Limited** [03:36] — Claude desktop connectors are new and immature: missing niche connectors, and some connectors lack full API capabilities.
- **Zapier MCP Server Solves Integration** [04:34] — Zapier provides a single MCP server with 8,000+ integrations. It acts as a single point of contact, eliminating token refresh and credential management headaches.
- **Custom MCP Client for Model Flexibility** [06:21] — The solution: build a custom MCP client in Python that connects to Zapier's MCP server, allowing easy switching between GPT, Gemini, Claude, and more with a one-line change. MCP is an open standard created by Anthropic.
- **Prompt Design and Filters** [07:32] — The prompt focuses on Slack messages where the user is mentioned (@codebasics.test), emails with 'task:' or 'update:' prefixes, and today's calendar meetings. This cuts through the clutter.
- **Model Switching Implementation** [11:11] — Main.py contains a get_llm function that creates clients for Grok, GPT, Gemini, etc. The model is selected by commenting/uncommenting a single line.
- **ReAct Loop in Custom Client** [12:39] — The custom client runs a while loop that mimics the ReAct pattern: call tools, observe output, call next tool. A counter can limit tool calls to avoid excessive bills.
- **Environment Setup** [16:38] — Copy .env.example to .env, add the Zapier MCP server URL and your API keys. Use UV to install dependencies with 'uv sync' and activate the virtual environment.
- **Running with Gemini and GPT** [18:35] — The agent ran with Gemini first, producing the morning brief. Switching to GPT required only one line change, and the same brief was generated, proving the flexibility.
- **Zapier SDK for Programmatic Access** [20:45] — Zapier SDK (Node module) allows listing apps and running actions (e.g., get Slack connection, list channels) programmatically via NPM.

### Conclusion

The video proves that building AI agents on open protocols like MCP, with a single integration hub like Zapier, provides model-agnostic flexibility and protects against vendor lock-in. This architectural mindset is essential for AI engineers in 2026.

## Transcript

noticed several Slack chat updates, emails, and meeting notification. And it really becomes hard to pay attention to what is important amidst all the clutter. To solve this problem, I built an AI agent this morning. It just pulled
my calendar, my email, my Slack, and gave me a 30-second brief on my day. Nothing weird about it, but watch this. With one line of code change, I can
switch between GPT, Gemini, Claude, and so on. Same agent, different models, so on. Same agent, different models, same brief. Three models, one agent, no rewrites. In the next few minutes, I'm going to show you how exactly I built
this. More importantly, I am going to show you why every AI engineer should be building this way in year 2026. Quick note before we proceed further, Zapier sponsored this video. But the angle why I am making this video at all, that is
mine. I have been building agents for past some time, and the lesson that I keep on learning the hard way is the one I want to share with you all today. [music] So, if that sounds fair, let's get into it. Today, we will write our
code in such a way that with one line code change, you can switch between the models. Now, why is this important? Let me tell you two horror stories. The first one is the developers who were paying for premium GPT-5 model, they
discovered that some of [music] their requests were routed to a cheaper variant of GPT under a load. The model selector in the dashboard still showed the original choice. So, the lesson here is that you think you are paying for the
model you picked, you are not. Story number two, Anthropic quietly degraded the Claude code coding harness with no announcement. Users discovered it production. The lesson here is your
tools can stop working overnight and no one will tell you. The point is not that these companies are bad, but this actually happened with some of the major model providers. If you are locked into a single vendor, then that means you do
not have a business, you have a dependency. What do you do about it? Let's brainstorm on how exactly we are going to build our agent. Right now, we going to build our agent. Right now, we have three tools Gmail, calendar, Slack.
In reality, in production systems, you can have 100 different tools. Here, you will have your large language model, which will interact with all these tools, and that agent will do the desired work for you. If you are a
programmer, the first option that comes to your mind is using LangChain. So, LangChain is a framework that allows you to build agent. Now, let's look at this code, where we have created agent in LangChain, and in the tools, we are
LangChain, and in the tools, we are using the calendar toolkit from Google. Now, check this code. Just for integrating Google Calendar, you have to write this much code. If you have 500 tools,
So, that is problem number one. Problem two is managing your credentials. So, you have to provide all kind of credentials. Tomorrow, if you want to switch to a different calendar, again, you have to create a new token JSON and
provide it here. Some of these tools also require you to refresh tokens because tokens have expiry. And that becomes nightmare. Every now and then, things will break. You have a large, bloated code base. So, let's
think about any other option. Tell me, does any other option come to your mind? Well, if you have used Claude, you can actually integrate all these you can actually integrate all these tools directly into your Claude desktop
application. Here, I have my Cloud desktop application open and here if you click on connectors you can integrate with so many But there is a problem here as well. The
problem is first of all they do not have all kind of connectors, okay? So you might be using some niche tool in your company and if Cloud doesn't have a then you are blocked. The other problem is some of these connectors do not have
full APIs. So the other day when I was using it, I wanted to use one tool where they do not have the API that I wanted. So the ecosystem here is kind of new and
it is not mature. So then how about we use a mature workflow ecosystem uh such as Zapier. So Zapier has been in automation business for so many years and they have integrations uh for more than 8,000 tools. And Zapier provides
this single MCP server that you can connect to your Cloud application which is MCP client here. All right, so this application that you is your MCP client and this is
your MCP server. Now in Zapier dashboard you can integrate all these tools. You can these tools and things become much easier because
you're connecting to only one thing. Zapier is your single point of contact, all right? So this solves that issue of connecting to so many things, managing tokens refreshing tokens and so on.
But there is another problem. People may not want to get locked into one vendor. We just mentioned that issue, right? If Cloud has a production outage or let's Cloud has a production outage or let's say if they silently switch and degrade
to a cheaper model, your app may break in production. You need agility. You in production. You need agility. You need some kind of dynamic approach where production. If things fail, you can quickly switch to a different model or
different vendor. For that, you can write a custom MCP client. Okay, we are tutorial using Python. And then we'll connect to Zapier MCP server. And our client will be such that
you'll be able to connect with GPT, Gemini, Claude, different models. And if things go wrong, you can switch it with just one line of code change. MCP, just in case if you don't know, is model context protocol. It is created by
Anthropic, but it is an open standard. Anyone can use this protocol. Anyone can use this protocol. You will see MCP support for all the major model providers, GPT and Claude and Gemini. They all support MCP. All
right, so we are going to use MCP now and we will start writing code. Let us work on setup. So, we are going to connect to our Slack. Okay, and I have a
Slack channel here. So, this is the Slack channel that we'll connect to. Now, I will show you my actual Teams. Okay, so look at this. I get so many messages, okay? And there are so many channels, so many discussions going on.
Right now, I am showing you Slack channel that we have created for this video purpose. But in reality, you just saw Teams looks pretty intense. So, in this Slack channel, I'm getting
all these messages. Okay, Siddhanth is saying, "Okay, provide update for next two videos, itinerary for Google IO." And so on. Okay, so I want to capture the essential updates. Whatever is tagged with at the word, I want to get a
morning brief for it. Also, for emails, I have tons of emails, but I'm interested in only those emails which starts with task colon or update colon. These are important emails for us. So, from all these clutters, I want to know
what is super important for me, which is these two. Okay, actually three. So, this task, this task, and this update. And for calendar, I want to get a brief summary of my today's meetings. Using the link in video description, log in to
Zapier. You can log in and create a free account. In this account, you will get 14 days free trial period, okay? So, you can play with various features. You can click on MCP servers. You can either click on this link, or you can say
mcp.zapier .com, okay? And here, I'm going to click on new MCP server. So, let's create a new MCP server here. In the bottom, I will select other. And here, you can
add tools. Select Gmail. Here, I will say find tools, which means I want to read emails. It selected two tools, okay? So, for email, see, you have tools such as find email, archive
email, delete email. I don't want agent to delete my email. So, I'm just giving access to kind of like read-only access to my email system. When you click on connect, here it will ask you to connect to your account. So,
when you say connect to new account, okay? It will ask you for Gmail credentials. You give it. I already gave my credentials. This is my test account, and I will say add two tools. Then,
Then, add, let's say, Google Calendar. Once again, all find tools. So, it selected five. Connect. Add file tools. &gt;&gt; [snorts]
tools. Select add tools. Select add tools. All right. So, see, connection was so easy. I integrated three different tools. You have 8,000 plus apps that you
can select from. I will give it some name. I will call it daily brief automation. Now, go to connect. And just say generate token.
And copy this URL. Okay, click on this. This is the URL that we will be using in our code. You can download the code from video description below. Here we are using UV as a Python package manager. So, these are the modules that
manager. So, these are the modules that we are using. Now, MCP is a Python You can see this. Okay, this is the module that will allow you to use the model context protocol. Once again, model context protocol is created by
Anthropic, but it is an open standard. To install the modules locally, you will To install the modules locally, you will say UV sync, and it will create this .venv directory
and install all the modules locally. Then, from command prompt, you will say venv scripts activate. So, your virtual scripts activate. So, your virtual environment is now activated. This is
how main.py looks like. You can switch between the models by just commenting and uncommenting another line. And in main, you have this function get LLM string. And if you look at that function, say if
it is Grok, you are creating Grok client. If it is GPT, you are creating OpenAI client, Gemini client, and so on. And once you get that client, you will And once you get that client, you will create an MCP session, and you will run
your prompt, okay? Now, if you look at this prompt, the prompt is common sense. You are a morning brief assistant. You have access to Gmail, Slack, Google Calendar, latest messages from 24 hours where @codebasics.test. By
from 24 hours where @codebasics.test. By the way, @codebasics.test is my ID here in the Slack. So, if you look at See my name, Dhaval. See codebasics.test. That's why I'm specifying that. I'm interested only in those messages. There
might be 1,000 other messages. I'm not interested in that. And from Google Calendar, pull today's event. And from Gmail, pull the emails which has task update colon or important colon, okay? And when you generate the
output, generate it in this format. This is very common sense prompt. You can is very common sense prompt. You can check it out. Now, what exactly is this Grok client, Gemini client, and so on? Well, we have vibe coded that. It is a
Well, we have vibe coded that. It is a custom client. So, let's look at maybe custom client. So, let's look at maybe OpenAI. So, here you are running the react loop of agent, okay? So, this while loop is essentially, you know,
when you have an agent, you will have this react loop, which is reason and this react loop, which is reason and act. Agent will call some tools, uh check the output, then again call some another tool. It's like as a human, if I
am putting a floor in in my uh home, I will put some floor, I will observe, then I will put some other nail, I will do finishing, and so on. So, we take action, observe the output, take second action, observe the output,
take third action. All of that is happening in this while loop, okay? Now, here we have used OpenAI module. So, if you search Python
OpenAI module, you will find this library. See, pip install OpenAI. So, that is what we have here. In OpenAI, we are going to use async API.
And we will be using chat completion. So, here just think you are calling OpenAI's GPT model in uh cloud environment. Okay, so this is the model self.model_id. Whatever model ID we got, this model ID, okay? So,
ID we got, this model ID, okay? So, let's say if I'm using OpenAI, this is the model ID GPT-5, mini, etc. And then this is the message. The message is prompt that we had, see? This prompt
to uh this model. And you will get a response. If the response doesn't have any tool call, which means it is done with that react
loop, okay? So, this is a while true, it's an infinite loop. So, you will keep on calling tools and when uh you have ended, you will uh return uh you have ended, you will uh return this. Maybe you can have some kind of uh
iteration as well. So, if you don't want it to go into infinite loop, you can put counter is um greater than 10, then break.
You can have this kind of counter as well, okay? plus plus. See? You can do that if you want to um have some kind of control on the tool
call so that you don't get like surprisingly high bill. But in our case, we have tried tested and it works okay. So, now uh the next step will be messages.append.
messages.append. As I said, agent will perform some task, consume the output, observe it, perform another task. So, putting all the messages in this kind of messages list, okay? And then you keep
on calling. So, now here, if you have tool call, you will call the tool with the arguments. Folks, I understand it can be little hard to kind of grasp all
of this. What you can do is you can take a look at the code with a calm mind, and you can try to digest it. It is really not hard, okay? You're calling all the not hard, okay? You're calling all the tools, and you are getting the response
from a tool call. So, let's say I want to get emails. So, this tool call will have Google Gmail. It will return the actual emails with task, update, colon, actual emails with task, update, colon, etc. prefixes. And then it will put the
some kind of formatting, okay? We are just formatting it by adding new line, minor. And then that result is given to the
And then that result is given to the content parameter in this messages list. the code we have. So, we have main file, we have MCP tools. I think MCP tools uh is something we did not look at it. So,
here, folks, first thing you have to do is take the environment examples file, copy-paste it as .env file, and in Zapier MCP URL, remember we created a URL in Zapier dashboard, you'll copy-paste that URL, and you will put
your API keys here. So, you get the Zapier MCP server URL, which you're passing it to your streamable HTTP client. And this HTTP client we have
imported from MCP Python module, okay? So, this is your MCP client. This client So, this is your MCP client. This client that you have created is an MCP client. And when you say as write, it will return the read pipe and write pipe,
return the read pipe and write pipe, which means the MCP server will read messages from this pipe. It's like a data stream uh from which it will read the messages, and it will write the messages to this particular pipe. So,
this is the output variable. Okay, this is just a variable in Python. As a result of calling this function, it will return these two. And it will return the third variable, which is not useful. That's why it's a common
convention in Python. I hope you know that. To use underscore. Now, read and write is the output we got by calling this method. We are passing that to our client. So, our client session is the MCP client session. And
this is a standard way of doing it. Okay, you create an HTTP client first, you get read and write stream, you pass through to your MCP client session, and through to your MCP client session, and then you say session.initialize.
we are getting it in our main function. See, MCP session. That same method we are getting from MCP tools. See, MCP tools, MCP session. That same one we are getting here. And then we are calling
client.run. And we are passing this session as a parameter. And here is our session as a parameter. And here is our prompt. Let me try Gemini model first, and let me run it. So, my virtual environment is already activated. Now, I
environment is already activated. Now, I can say simply python main.py. Look at this. It gave the output. So, my It gave the output. So, my urgent email is update Agentic AI video
is being processed for release. So, let's go to my email. See, Agentic are the emails from today, by the way. Today is May 15. It did not take emails from yesterday, May 14th, because I have given it
instruction here. See, last 12 hours unless noted. So, it will take emails from last 12 hours. And in last 12 hours, this is the email with update uh
tag. If there were other emails uh which doesn't have a tag, it will not take doesn't have a tag, it will not take that. And then in Slack, see, I have uh received all these notifications. So, let's go to Slack.
These are the notification in last 12 hours. And then for calendar, I have two meetings, Google I/O sync-up, AIPM cohort planning. See, Google I/O sync-up, AIPM cohort planning. So, this way uh I can get the
important information out of all the clutter I have in my life. I have so many Slack messages, so many emails. I don't know what is important. Every morning when this agent sends me this kind of morning brief, I know exactly
what to focus on. Let's now change the model to GPT, okay? From Gemini, we are switching to GPT. Just one line of change. Run the code again. This way, if Anthropic uh deprecates
Opus tomorrow, my agent doesn't break. If OpenAI silently routes my request to a cheaper model, I have a way to change my model here, okay? Just just change this line, and you should be good. Isn't this amazing? See, now with OpenAI
this amazing? See, now with OpenAI model, I am getting the same daily brief. One last thing I want to mention is Zapier SDK. Let's say you want to access all these integrations in Zapier via code.
How do you do that? See, previously, we wrote code, but that code was for our MCP client. We used MCP server directly from Zapier. But let's
say you want to access all these individual tools programmatically. How do you do that? Well, you use Zapier SDK. So let me just show you some code here. So if you click on start building up for free,
up for free, see, you install Zapier via NPM. It's a node module, basically. And then, in the code, you can list all the apps. For example, by writing this code, you
can list all the apps which are supported. You can run the actions get Slack connection, and then list Slack channels, and so on. All right, I'm going to provide a link. Explore it if you are interested in
programmatic access of Zapier tools. If you're learning AI engineering in 2026, this is the architectural mindset that will save your career. Models keep on changing. Provider do the things you do not like. The builders who win are the
ones who build on open protocols and treat model as a commodity input. And this is the exact kind of thinking that we are teaching to our students in our live AI engineering cohorts. We have
sessions on weekends over Zoom. If you want to learn more, the link is in video description. But you do not need a boot camp to start. You can build what I built today this afternoon for free. All
right, that's all I had. If you have any questions, post in the comment box questions, post in the comment box below. Thank you very much for watching.
