A practical guide to AI Agents on Cloudflare
Presented by: György Márk Varga
Originally aired on December 1 @ 2:00 PM - 2:30 PM EST
Highlights from Cloudflare Immerse: Tallinn — and what an incredible day!
We were thrilled to welcome customers and partners from across Eastern Europe, including speakers from Raiffeisen Ukraine, Latvian Mobile Telephones, Estonia's Railways, Delfi Media, Shiwaforce and TV3 Group, for a day of insightful discussions, bold ideas, and forward-looking innovation.
Together with Cloudflare leadership and our regional technical team, we dove deep into the future of the internet — from the evolving role of AI to building secure networks with Zero Trust.
Massive thank you to everyone who joined us and made it such a memorable event.
English
Transcript (Beta)
Welcome, everybody. It's great to be here. Thank you for the switch. And you can see I'm presenting on my own laptop, so everything can quite be a bit difficult here, but we managed to figure it out.
So we are going to talk about AI agents built on top of Cloudflare today.
If you are having difficulty reading the presentation or you want to save it yourself, you can scan this QR code and it will automatically download it to your mobile phone if you want it.
And as mentioned, I'm a product developer at Shiva Force.
Here are all my credentials, my ex-Twitter account, and of course, my GitHub.
And I even have my own MCP server deployed on Cloudflare MCP remote.
We're going to talk about it. What is it? But you can just try it out.
So an unfamiliar like somebody from me at like from Grok AI, I'm a software developer.
I passionately code at Shiva Force. I like investing and I'm into tech, building apps and video games.
That's from my official Twitter account. I'm also an active contributor on Cloudflare agents starter repository.
So if you start to build AI agents on Cloudflare, probably you will meet my code too.
As I mentioned, I work at Shiva Force. We are actively partnering with Atlassian, with AWS, and of course, why we are here, Cloudflare too.
So actually my biggest challenge preparing for this talk is the very often changing like change log of these kind of AI tools.
And of course, Cloudflare, because actually one month ago they had like a developer week.
In the developer week, they were like, they were like constantly like introducing new changes and new stuff and innovative stuff.
So I needed to like upgrade my presentation, my code examples and so on either way.
But that's kind of what we thought the world that we live in right now.
So this was like the warmup from me here. And after that, we're going to talk about AI agents, MCP, the agent SDK from Cloudflare.
We are going to see some use cases and demos.
And after that, we're going to have some takeaways and what will the future hold us.
So as I mentioned, we are going to talk about AI agents. Here is a great example, like very simple example, what our agents are.
So as you can see on this picture that we have input probably from a user.
After that, there is like a large language model and there is a tool or tools and there will be output.
It will be incrementally execute these kind of tool calls.
We will see some examples, but the LLM will decide which tool to call for the appropriate job.
So to further understand it, we can just compare workflows, copilots, and of course, agents.
So workflows are very well known by us and by everybody, I think. So these are linear, fixed tab, there is no autonomy and it can fail on surprises.
For example, a CI-CD workflow, you can see that it probably will have some issues during the build step or something like that.
It will fail and not execute forward.
On the other hand, copilots, like for example, the new Gemini copilot that was built in Gmail, you can suggest something like summarize an email or reply to that email with these kind of words, but you are the one that decides and after that you will hit the send button.
On the other hand, agents can be like very, very fully autonomous and it can be dynamic and what is more important, then on the other hand, it can handle surprises.
So we are going to start from this building box to build like a full agents.
So to understand agents' nature and also this kind of ecosystem, we need to understand some acronyms.
For example, MCP. MCP stands for Model Context Protocol, as you can see, and we have a great picture to demonstrate the power of it.
So actually, when we are doing and we are working with MCP, it was very easy to integrate to our tools that we know and love.
So for example, there is like a great acronym here that this is a USB-C that will connect to large language model and to our well-known chatbots or even AI agents with the tool set that our applications that we currently use, for example, Slack or even Jira or even Linear or something like that, that will provide.
We will see some example based on that and it is actually developed a couple of months ago, so it is very new.
That's why I said that these ever-changing changelogs are very much a problem here, but it was getting very, very great traction here.
If you see the Microsoft Build event or the Google IO, you will see some example based on MCPs.
So let's see some MCP examples here before we dive into the other topic.
So as you can see on this prompt and also the picture, I will ask or I'd ask our chatbot to like prepare some Confluence docs and some tasks in Jira based on this picture that I drew.
So what is the workflow here is that we have like an MCP host, Cloud, a course or any kind of AI agents that we can also build.
We will connect with the Atlassian MCP server that was on like the previous example before and after that we can have the relevant docs in green and also the tasks in Confluence and Jira.
So I will open my Cloud here and you can see that I've got these steps prepared.
It was running like for example one or two minutes, so that's why I prepared it early on.
So what is the magic here is you can see that we have the same prompt here and we have the same picture and we can have some tool calls.
You can see here that it is calling to like Atlassian tool sets, like for example these are familiar methods or products, like for example create Confluence page or we can even create Jira issue based on this prompt.
So you can see that I connected our Atlassian MCP server to this one and we can have the LLM to have these kind of tool sets, like for example create Jira issue, edit Jira issue and these kind of tools.
On the other example that we have is a much more complex one.
So we need to fetch from a parking application that we have internally at our company the most urgent task from another task manager called Linear and after that we need to finish the task.
So for example commit push to the same project on GitHub and also check that it is deployed and it is working fine and we automatically test it out.
So this is like the tool set that we have here.
We are connected to the Linear MCP server, to the GitHub MCP server, also from the Cloudflare MCP server to check the deployments, because of course it was deployed on workers and after that we can recursively just check back with Playwright and check whether it is working or not.
So this is actually also done here on my other chat here, if it loads.
So you can see that we have this prompt here and it will like plan and with one shot we can go through these kind of steps.
So for example check the GitHub, also check whether there were commit and push, also check whether the worker was deployed or not and we can check it back later with Playwright.
So you can see that this is listing issues and also getting the file context, also get the commits and even create or update file.
And what I meant by it can correct itself, that here you can see that there was like an error and the error was that we needed to include the SHE key here also with the files.
And with one shot it can like work through like a whole development like ecosystem workflow.
After that we can even just check back with Playwright and it will call the initial methods or the methods that was defined by the Playwright MCP servers and in the end we've got all the stuff working here with a merged like commit and with all kind of stuff tested back.
You can get more like very interesting examples on the official Cloudflare MCP demo day, which was like presented one month ago.
There were like companies what they are building on top of Cloudflare ecosystem to build the MCP remote servers.
So for example Block, Atlassian, which I mentioned before, or Paypal or even Stripe.
So let's move on to the agent's SDK, which is like a complementary also product.
So we can on agent SDK there are these kind of like feature that it initially provides us.
So we have state management on agents, we have also real-time communication and it is like flexible and customizable.
For example for an agent can like connect to MCP server like tool set, which I described before, or even our own tool sets.
We can use any kind of AI models. So we can use the AI models that are actually open source and deployed on Cloudflare, like for example Llama4 or even we can call out to Entropiq API or even we can call out to OpenAI API too.
So actually agent was built on top of like a complementary product from Cloudflare, which is DurableObject.
If you know this product, you know that this is like very powerful and it was like developed a couple of years ago and it was like before the AI hype went through.
So actually it was like a visionary stuff to deploy too.
And you can see that actually DurableObjects are like this.
So you can see that we can deploy for one single application like many millions of DurableObjects or even billions.
And in this DurableObject we have like in one instance the app server and the SQLite like persistent storage can run.
So for AI agents it can be very helpful because we can run many millions of AI agents and we can connect it with like some persistent storage and also with some real-time capabilities.
So for example you can see on this chart that we have a feature from DurableObject and it was purposely built on top of AI agents.
So that is why we can have here like for example the built-in persistence the agent can have also a memory.
Or for efficient resource usage we only pay for like compute time, not like wall clock time.
So we are only paying for when the agent is active.
So to pierce through these kind of puzzles here is like a picture on the big picture as you can see on the chart.
So we have the end user device which can be like a browser or can be like a mobile app or anything else.
And we will connect it to the Internet and there will be like many AI agents probably built on top of agents SDK.
And these are AI agents can act also like an MCP client with OAuth 2.1.
We can connect it to an MCP server and after that we can like have some tool set that the AI agent can use from the MCP tools.
Also this is you can connect it to any kind of API endpoint.
You can even write some own custom tools in the AI agent which is not like MCP tools coming from third party but you can also build that.
Or you can also build your own MCP server like on top of Cloudflare.
Actually it is like a one minute job so not that very difficult. So in the final and second part of my presentation we can just walk through some use cases and demos and I can also will show some codes regarding on the agent SDK.
So the use cases for AI agents are as follows. So actually these are the stuff that you need read on the media or any kind of media outlet that is like kind of like boring.
We can like have some customer service automation. We can have a personalized education AI agent or personal assistant and of course we can just we can just orchestrate these kind of agents.
And of course research agents, HR recruiter and many many more.
But we try to like use it in our like workplace in our like development workload because mainly we are a development company so we need to like automate a lot of stuff regarding on development processes, regarding on automated testing and so on.
So in the flow we try to like build and also experiment with these kind of tools.
So for example this can be a great flow like we have an issue from your favorite project management software.
It can be anything like Atlas from Atlassian or even Linear.
We can solve the task on our repository for example GitHub or GitLab.
I even have GitHub in this example. We can deploy it automatically to Cloudflare and we can check back with some kind of MCP tool that we have for example a Playwright MCP server.
It can also do the task and it was like as you've seen on the previous example was done like automatically here.
So these are the kind of workflows that we try to try to monitor and try to automate and it much of course can handle surprises.
So actually what we shipped and what we what we build is like an agent hub at our company.
Of course it is like a worker that was deployed on Cloudflare and we have we have like a work in progress application on our parking lot where others can book some parking spaces and so on.
It is like a work in progress so it doesn't even have like database for example.
So what we have is if I click on like the app developer agent you can have like a chatbot here which can connect to many many MCP connections and MCP tools.
So for example here I have linear MCP and here I have Cloudflare binding.
So what can we do here is that we add like a prompt here which we are going to talk about.
So you can see on this parking application which I mentioned that we don't have like a database and we need it to like all we have all we need like an access is like the worker code which is actually deployed.
So with that we can have like the necessary administration on our task management project and we can also build like the code like the tables like all the hash co-occurrence and of course built on or and deployed on to the one which is like a Cloudflare project.
So we can like initialize this kind of request and it can plan our like workflow.
So for example we can call the necessary workflows like for example get the worker code you can see on this example here that we are getting like the worker code and it analyzes the project that we needed to have like this kind of example and after that for that kind of mock backend code it will automatically call the Cloudflare like MCP tool which is create a d1 database and after that we can also query that database with like the necessary tools and all these kind of like necessary stuff and even it can comment our issue our progress.
So you can see here that here is like the example and with all of course there is like the comment from here that the database creation was okay and these are the stuff and these are the tables that was created and also we have like this example here with the d1 database I refreshed it and there is like the three table database that we have for the application and it was like working bookings parking slots and even users are there and of course the administrative stuff and also the development stuff are done with like one prompt with our like AI agents this is what we try to automate and try to work on.
What another example can be is like an automation tester agent we have like our internal web application or our internal project which is shivaforce .com which you can access and there can be like many many workflows to test it out with automation so you can see that we have with this kind of cookie like models and GDPR cons and functionality and compliance functionality we need to test it out whether it is working or not.
So what I've done here is that please do the job please do the testing job which is like this code from linear and it will just get the necessary data from the issue it will get whether it is the issue is exist or not and after that our like mcp integration which is connected to playwright will just check whether the cookie are like displaying or not with this kind of tool sets that we have it and it was like working for like two minutes and it is done and after that it can comment on the issue whether it is working or not so you can see that this is how it went.
So these are the processes that we are trying to automate with agents SDK and we try to build on top of that and you can just getting get started with like very easily with some couple of lines of code you can just download like the like the template which I also not active contributor upon and here are like our agent this is like a class and we can add some mcp tools or even we can just add our own tool set for example if we need some zephyr statuses from Jira for an automation tester then we can do that of course.
So what can be like the main takeaways here as I mentioned here the main one can be like AI cost can be hard to predict okay that was like that was like a boring one lucky we have like AI gateway on Cloudflare so we can monitor this kind of cost and what is other blocking example is that not all platforms have remote mcp servers so for example which linear and also github has like mcp servers but for example github is not remote yet so they are working on remote mcp servers and they are not quite there yet so I was also afraid about the about the demo whether it was working now but it was working perfect so actually there are a lot of crashes that we need that the mcp protocol can improve upon it was like when I started working with it actually in December there were like many very worse from this standpoint but actually right now it is like kind of like just working but there are some kind of issues there so our biggest takeaways are that we need great foundation rapid start which can be of course on top of Cloudflare with the SDK it is just very easy to ship things and of course you can just ship things so try it out break things move fast and you can start building like a couple of minutes and of course you don't need to use mcp and this kind of asian stuff for very simple workflows so you can find the right tool for the right job and my most important advice is that you need to browse x and also changelog very often because the industry is moving very fast here there is a lot of topics that we didn't cover in this kind of 20 minutes session so we need uh also have like agent orchestration bandwidth went agent agent to agent communication agent as mcp also can act like as an mcp client and also an mcp server and even my own mcp server we didn't take a look at it but we will be here and also I will be here with my own laptop so if you want to come on and like put together your agent workflows here and then I can help and with this kind of like commands you can just ship very very easily so thank you very much
