---
title: AI Agents on Vercel
description: This guide provides an overview of how to build and deploy AI agents on Vercel.
url: /kb/guide/ai-agents
canonical_url: "https://vercel.com/kb/guide/ai-agents"
last_updated: 2025-11-10
authors: Lee Robinson
related:
  - /docs/functions/fluid-compute
  - /docs/rest-api
  - /docs/deployments/claim-deployments
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

Vercel provides AI infrastructure for you to build agents. Further, agents can programmatically create and manage deployments on Vercel, then later allow users to transfer ownership of the created deployment to their account.

## Overview

- [How to build agents with the AI SDK](#how-to-build-agents-with-the-ai-sdk)
  
- [Build your own MCP server](#build-your-own-mcp-server)
  
- [Build an MCP client with the AI SDK](#build-an-mcp-client-with-the-ai-sdk)
  
- [Fluid compute](#fluid-compute)
  
- [AI agent examples in production](#ai-agent-examples-in-production)
  
- [Vercel SDK for Deployments](#vercel-sdk-for-deployments)
  
- [REST API for Deployments](#rest-api-for-deployments)
  
- [Vercel CLI for Deployments](#vercel-cli-for-deployments)
  
- [MCP Server](#mcp-server)
  
- [Allowing users to claim deployments](#allowing-users-to-claim-deployments)
  
- [Sign in with Vercel (private beta)](#sign-in-with-vercel-private-beta)
  

## Running agentic code on Vercel

Vercel provides infrastructure and SDKs to deploy AI agents. You can deploy single JavaScript or TypeScript files, which run single or multi-step workflows. In addition, Vercel can integrate with databases, AI inference, and more through the [Vercel Marketplate](https://vercel.com/marketplace) with first-party billing.

### How to build agents with the AI SDK

The AI SDK provides a unified interface to switch between different AI models. Additionally, it has full support for tool-calling and building agentic systems.

Learn more in the AI SDK docs about the following patterns:

- [Sequential Processing](https://sdk.vercel.ai/docs/foundations/agents#sequential-processing-chains) - Steps executed in order
  
- [Parallel Processing](https://sdk.vercel.ai/docs/foundations/agents#parallel-processing) - Independent tasks run simultaneously
  
- [Evaluation/Feedback Loops](https://sdk.vercel.ai/docs/foundations/agents#evaluator-optimizer) - Results checked and improved iteratively
  
- [Orchestration](https://sdk.vercel.ai/docs/foundations/agents#orchestrator-worker) - Coordinating multiple components
  
- [Routing](https://sdk.vercel.ai/docs/foundations/agents#routing) - Directing work based on context
  

### Build your own MCP server

If you want to build your own MCP server on Vercel’s infrastructure, you can use the following templates for using a framework (Next.js) or without:

- [Model Context Protocol (MCP) with Vercel Functions](https://vercel.com/templates/other/model-context-protocol-mcp-with-vercel-functions)
  
- [Model Context Protocol (MCP) with Next.js](https://vercel.com/templates/next.js/model-context-protocol-mcp-with-next-js)
  

Deploying an MCP server to Vercel with Fluid Compute enabled ensures your AI-driven requests always have low-latency and can scale automatically. If your agents need ephemeral storage, consider using Redis from the [Vercel Marketplace](https://vercel.com/integrations).

### Build an MCP client with the AI SDK

In addition to running your own MCP server, you can connect to it from your AI applications using Vercel’s [AI SDK](https://sdk.vercel.ai/). By initializing an MCP client, your AI code can discover and call tools published by any MCP server—whether local or remote—through a standardized interface.

For more on MCP with the AI SDK, see the [official docs](https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling#mcp-tools).

### Fluid compute

[Fluid compute](https://vercel.com/docs/functions/fluid-compute) is Vercel’s next-generation compute platform. It allows your code—generated or orchestrated by an AI agent—to:

- **Scale automatically** while minimizing cold starts
  
- **Run background tasks** after responding to the user (via `after` or `waitUntil`)
  
- **Run concurrent workloads** in a cost-effective way
  

This is especially useful for agentic code that may spin up ephemeral processes, generate complex responses, or coordinate multiple steps without timeouts typical in traditional serverless environments.

We strongly recommend enabling Fluid compute for your AI agent applications. Further, you might additionally want to use integrations like [Inngest](https://vercel.com/integrations/inngest) or [Upstash Qstash](https://vercel.com/marketplace/upstash) with your Vercel Function.

### AI agent examples in production

Here are some examples of AI applications built on Vercel’s agent infrastructure:

-  – Vercel’s agent for building web apps
  
- [glif.app](https://glif.app) – Fun AI apps anyone can build
  
- [ohara.ai](https://ohara.ai) – Create apps & games and buy a stake in them
  
- [a0.dev](https://a0.dev/) – Mobile apps in minutes
  
- [gumloop.com](https://www.gumloop.com/) – AI automation framework
  

## Creating deployments from AI Agents

### Vercel SDK for Deployments

The [Vercel SDK](https://github.com/vercel/sdk) is a TypeScript toolkit that exposes all the same operations as the REST API, with optional convenient streaming for file uploads, typed responses, and integrated error handling.

``import { Vercel } from "@vercel/sdk"; import crypto from "node:crypto"; const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN>" }); const teamId = process.env.TEAM_ID; async function deployToVercel() { // Create your project files as a buffer const fileBuffer = /* your zipped project files as a buffer */; // Calculate SHA1 hash of the file const fileSha = crypto.createHash("sha1").update(fileBuffer).digest("hex"); // 1. Upload the file to Vercel await vercel.deployments.uploadFile({ teamId, headers: { "Content-Type": "application/octet-stream", "x-vercel-digest": fileSha, "Content-Length": fileBuffer.length.toString(), }, body: fileBuffer, }); // 2. Create deployment with the uploaded file const deployment = await vercel.deployments.createDeployment({ teamId, requestBody: { files: [{ file: ".vercel/source.tgz", sha: fileSha, } ], projectSettings: { framework: "nextjs", }, name: `nextjs-deployment-${Date.now().toString(36)}`, }, }); return deployment; }`` ### REST API for Deployments You can call the [Vercel REST API](https://vercel.com/docs/rest-api) directly from your AI agent. A typical flow might be:

1. Obtain an access token ([how to create one](https://vercel.com/docs/rest-api#creating-an-access-token)).
   
2. Upload your build artifacts with `POST /files`.
   
3. Create a deployment with `POST /deployments`.
   
4. Optionally, assign a domain or set up aliases.
   

For more detail, see the [claim deployments demo](https://claim-deployments-demo.vercel.app/) and its [source code](https://github.com/vercel/claim-deployments-demo).

### Vercel CLI for Deployments

The Vercel CLI provides a command-line interface for creating deployments directly from your local environment or within automated workflows. It's particularly useful for AI agents that need to deploy projects programmatically.

`vercel login # Or authenticate with a token in CI/CD environments vercel --token <YOUR_TOKEN> # Deploy the current directory and accept default prompts vercel --yes # Deploy with specific project settings vercel --name my-ai-project --prod --scope my-team-slug # Deploy and also print back the build logs vercel deploy --logs`

### MCP Server

Vercel’s [Model Context Protocol (MCP)](https://github.com/vercel/sdk?tab=readme-ov-file#model-context-protocol-mcp-server) server allows AI models to talk to your Vercel account. Through tool calling, the MCP server can do the following and more:

- List Vercel projects
  
- Create deployments
  
- Upload files for a deployment
  
- Manage domains and DNS
  

With MCP, you run a local or hosted server that speaks this protocol. AI agents (e.g., using Claude or Cursor) can connect to it and automatically call Vercel operations without you writing custom code.

For example, configure the Vercel MCP server in your client:

`npx --package @vercel/sdk mcp start --bearer-token "<YOUR_BEARER_TOKEN>"`

Then, integrate with AI IDEs like Claude Desktop or Cursor by configuring `.cursor/mcp.json` or `claude_desktop_config.json`:

`{ "mcpServers": { "Vercel": { "command": "npx", "args": ["-y", "--package", "@vercel/sdk", "--", "mcp", "start", "--bearer-token", "..." ] } } }` You can then begin prompting your AI agent to use tools. For example, you could ask things like “deploy to Vercel” or “list my Vercel projects”. When the updated MCP is released with support for OAuth, we will be moving to a remote server to simplify this process. [Learn more in the docs](https://github.com/vercel/sdk?tab=readme-ov-file#model-context-protocol-mcp-server).

## Allowing users to claim deployments

AI agents can create deployments on your (the agent’s) Vercel account, but often you want the end user to “take over” that deployment. [Claimable deployments](https://vercel.com/docs/deployments/claim-deployments) is Vercel’s flow for letting users transfer ownership of a deployment by visiting a claim URL.

1. **Agent sets up** the deployment with minimal code.
   
2. **Agent provides** a [Claim Deployments URL](https://vercel.com/docs/deployments/claim-deployments) to the user.
   
3. **User logs in** to Vercel and chooses which team or personal account to transfer the deployment to.
   

### Example Flow for an AI-Generated Deployment

1. **Upload files** via `POST /files`.
   
2. **Create the deployment** with `POST /deployments`.
   
3. **Generate claim URL**: `/claim-deployment?code=YOUR_CODE&returnUrl=https://acme.com`
   
4. **Share the link** with the user to complete the transfer.
   
5. **User claims** the deployment, optionally selects a team, and finalizes the ownership transfer.
   

For more detail, see the [claim deployments demo](https://claim-deployments-demo.vercel.app/) and its [source code](https://github.com/vercel/claim-deployments-demo).

### Sign in with Vercel (private beta)

We’re working on an OAuth provider so agents or third-party apps can integrate with Vercel.

This will allow your applications to securely access Vercel account information when authorized by the user. If you are interested in building an AI agent that could take advantage of this, please [reach out](https://community.vercel.com/) to our team.