Connect Vercel to Claude: Control Domains, DNS, and Environment
Learn how to connect Vercel to claude using Truto. Step-by-step guide to tool calling, API quirks, and autonomous workflows.
If your team uses ChatGPT, check out our guide on connecting Vercel to ChatGPT or explore our broader architectural overview on connecting Vercel to AI Agents.
Giving a Large Language Model (LLM) read and write access to your Vercel infrastructure changes how your DevOps and product teams operate. Instead of clicking through the Vercel dashboard to verify DNS propagation, rollback deployments, or sync environment variables across projects, you can direct Claude to execute these tasks using natural language. To make this work, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's function calls and Vercel's REST APIs.
You can either build and maintain this infrastructure yourself, dealing with OAuth lifecycles and schema mapping, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL. This guide breaks down exactly how to use Truto to generate a managed MCP server for Vercel, connect it natively to Claude Desktop, and execute complex infrastructure workflows.
The Engineering Reality of the Vercel API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against Vercel's API is painful. You are not just building a generic wrapper - you must handle Vercel's highly specific resource models, pagination patterns, and scoping rules.
If you decide to build a custom MCP server for Vercel, here are the specific engineering challenges you will face:
Team-Scoped vs User-Scoped Execution
Vercel's API endpoints require explicit scoping. Most endpoints accept a teamId query parameter. If this parameter is omitted, the API defaults to the authenticated user's personal account. For enterprise use cases, this causes silent failures. An AI agent might attempt to fetch a project, receive a 404, and hallucinate that the project was deleted - simply because it failed to append the teamId of the organizational workspace. A proper MCP layer must handle this context transparently.
Complex Environment Variable Targets
Vercel does not treat environment variables as simple key-value pairs. An environment variable belongs to specific target environments, represented as an array (e.g., ["production", "preview", "development"]). If an AI agent attempts to create or patch an environment variable and provides a string instead of an array, or submits an invalid target, Vercel rejects the payload. Building schemas that force the LLM to construct these arrays correctly requires strict JSON Schema enforcement within your tool definitions.
Strict Rate Limits and Header Normalization
Vercel enforces strict rate limiting, particularly on mutation endpoints like triggering deployments or modifying DNS records. If an LLM executes a looping task (like auditing 50 domains), it will hit a 429 Too Many Requests response. Truto does not retry, throttle, or apply backoff on rate limit errors. Instead, when Vercel returns a 429, Truto passes that error directly to the caller. Crucially, Truto normalizes Vercel's specific rate limit headers into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The caller - in this case, Claude or your agent framework - is responsible for reading these headers and implementing its own retry and backoff logic.
How to Generate a Vercel MCP Server with Truto
Truto dynamically derives MCP tools directly from the Vercel API documentation and integration configurations. There is no hand-coded boilerplate. You authenticate the Vercel account once, and Truto generates a secure JSON-RPC 2.0 endpoint.
You can provision this server via the Truto UI or programmatically via the API.
Method 1: Via the Truto UI
For internal tooling and DevOps teams, the dashboard provides the fastest path to a working server.
- Navigate to the integrated account page for your active Vercel connection in the Truto dashboard.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Configure your filters. You can restrict the server to specific methods (like
readonly) or specific tags (likednsorprojects). - Copy the generated MCP server URL. This URL contains a secure, hashed cryptographic token - treat it like a secret.
Method 2: Via the Truto API
If you are building an AI product and need to provision MCP servers for your own customers dynamically, use the REST API. This endpoint validates that the integration has tools available, generates a secure token, and returns a ready-to-use URL.
Endpoint: POST /integrated-account/:id/mcp
// Example: Creating a read-only Vercel MCP server
const response = await fetch('https://api.truto.one/integrated-account/YOUR_ACCOUNT_ID/mcp', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TRUTO_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Vercel Audit Server",
config: {
methods: ["read"],
tags: ["projects", "domains"]
}
})
});
const data = await response.json();
console.log(data.url); // https://api.truto.one/mcp/abc123def456...How to Connect the MCP Server to Claude
Once you have your Truto MCP server URL, connecting it to Claude requires no additional code. The URL itself acts as the complete transport mechanism.
Method A: Via the Claude UI
If you are using Claude's web interface or enterprise workspace:
- Open Claude and navigate to Settings -> Integrations -> Add MCP Server.
- Paste your Truto MCP server URL into the configuration field.
- Click Add. Claude will immediately perform a handshake with the server, requesting the
tools/listendpoint to discover all available Vercel commands.
Method B: Via Manual Config File (Claude Desktop)
For developers using the local Claude Desktop application, you can map the server using the standard MCP configuration file (claude_desktop_config.json). Since Truto provides a Server-Sent Events (SSE) endpoint, you utilize the official remote transport adapter.
{
"mcpServers": {
"vercel-truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/YOUR_SECURE_TOKEN"
]
}
}
}Save the file and restart Claude Desktop. The Vercel tools will immediately appear in Claude's tool menu.
Vercel Hero Tools for Claude
When Claude connects to the Truto MCP server, it gains access to the fully normalized Vercel API. Here are six high-leverage tools your agents can use immediately.
list_all_vercel_projects
Fetches a paginated list of all projects within the Vercel account or team. This tool returns deep configuration data, including framework settings, build commands, and analytics status. Truto automatically injects limit and next_cursor schema properties so Claude can iterate through massive enterprise workspaces without hallucinating pagination parameters.
"Fetch all Vercel projects in our main team workspace. Identify any projects that are using Next.js but have Speed Insights disabled, and output them in a markdown table."
create_a_vercel_project_env
Allows Claude to inject new environment variables into a specific project. The LLM must supply the project_id, key, type, value, and the critical target array (e.g., ["preview", "development"]). This is invaluable for automating database credential rotation or setting up new staging tiers.
"I need to add a new environment variable to the 'frontend-web' project. The key is 'STRIPE_WEBHOOK_SECRET', the value is 'whsec_12345', and it should only be applied to the 'preview' and 'development' targets."
list_all_vercel_domains
Retrieves all Apex domains registered or managed within the Vercel account. It returns verification status, nameserver configurations, and expiration dates. This tool is critical for auditing infrastructure, especially when hunting for unverified domains or domains with missing DNS challenges.
"List all domains associated with our Vercel team. Check the verification status of each, and flag any domains that are missing their intended nameservers or failing verification."
create_a_vercel_domain_record
Grants Claude the ability to manage DNS records directly. The agent can create A, CNAME, TXT, or MX records for any managed domain. Because Vercel's API expects specific payload structures for different record types, the MCP schema strictly guides the LLM to format the request correctly.
"Create a new CNAME record for the domain 'acme-corp.com'. The name should be 'blog', and it needs to point to 'hashnode.network'. Make sure the TTL is set to 3600."
create_a_vercel_deployment
Triggers a new deployment for a project. While typical git-based deployments happen automatically on push, this tool allows Claude to trigger manual deployments, specific commit rollbacks, or API-driven builds based on external triggers.
"Trigger a new deployment for the 'backend-api' project using the latest commit from the 'main' branch. Monitor the deployment status and let me know when the build process begins."
vercel_deployments_cancel
An emergency intervention tool. If a deployment is stuck, or if an engineer realizes a bad commit was just pushed, Claude can immediately halt the build process before it reaches production.
"Cancel the deployment that is currently in progress for the 'auth-service' project immediately. The deployment ID is 'dpl_789xyz'."
To view the complete inventory of Vercel operations, including edge configuration, log drains, and team member management, visit the Vercel integration page.
Workflows in Action
Access to individual tools is useful, but the real power of MCP lies in giving Claude the ability to chain these operations together to execute complex infrastructure workflows.
Scenario 1: Provisioning a Staging Environment
Developers frequently need to spin up identical preview environments, complete with mirrored environment variables and database connections.
"Set up a new environment variable called 'DATABASE_URL' with the value 'postgres://stg_db' for the project 'core-app', but only target the 'preview' environment. Once that is saved, trigger a new deployment for that project from the 'staging' branch."
Step-by-Step Execution:
- Claude calls
create_a_vercel_project_env, passing theproject_id, the keyDATABASE_URL, the value, and setting the target array strictly to["preview"]. - Vercel responds with the created variable metadata.
- Claude calls
create_a_vercel_deploymenttargeting thecore-appproject and specifying the git source branch asstaging. - Claude reads the deployment ID from the response and informs the user that the staging build is underway with the updated database credentials.
Scenario 2: Emergency DNS Rollback
When a marketing site goes down due to a misconfigured DNS record, time is critical. An IT admin can rely on Claude to audit and revert the changes.
"Our domain 'marketing-site.com' is failing. Check all the DNS records for that domain. Find the CNAME record pointing to 'old-provider.com', delete it, and create a new CNAME pointing to 'cname.vercel-dns.com'."
sequenceDiagram
participant User
participant Claude as Claude Desktop
participant Truto as Truto MCP Server
participant Vercel as Vercel API
User->>Claude: "Check DNS for marketing-site.com..."
Claude->>Truto: Call list_all_vercel_domain_records<br>{"domain": "marketing-site.com"}
Truto->>Vercel: GET /v4/domains/marketing-site.com/records
Vercel-->>Truto: Return DNS records array
Truto-->>Claude: JSON response
Note over Claude: Claude identifies the bad<br>CNAME record ID
Claude->>Truto: Call delete_a_vercel_domain_record_by_id<br>{"domain": "marketing-site.com", "id": "rec_123"}
Truto->>Vercel: DELETE /v4/domains/.../rec_123
Vercel-->>Truto: 200 OK
Truto-->>Claude: Success confirmation
Claude->>Truto: Call create_a_vercel_domain_record<br>{"domain": "marketing-site.com", "type": "CNAME", ...}
Truto->>Vercel: POST /v4/domains/.../records
Vercel-->>Truto: New record metadata
Truto-->>Claude: JSON response
Claude->>User: "The old record is deleted and<br>the new CNAME is active."Step-by-Step Execution:
- Claude calls
list_all_vercel_domain_recordsfor the specified domain. - Claude parses the JSON response, filtering for
type: "CNAME"and the bad value. - Claude extracts the
idof the bad record and callsdelete_a_vercel_domain_record_by_id. - Claude immediately calls
create_a_vercel_domain_recordwith the correct Vercel CNAME value. - Claude confirms to the user that traffic is successfully rerouted.
Security and Access Control
Exposing your core production infrastructure to an LLM requires strict governance. Truto MCP servers include built-in access controls to limit the blast radius of AI operations:
- Method Filtering: When creating the server, you can restrict it to specific operations. Setting
methods: ["read"]ensures the LLM can audit domains and view projects, but physically cannot trigger deployments or alter DNS. - Tag Filtering: You can scope the server to specific Vercel API domains. For example, setting
tags: ["dns"]ensures the agent can manage domains but has no access to project environment variables or team member rosters. - Extra Authentication (
require_api_token_auth): By default, possessing the MCP URL is enough to connect. Enabling this flag requires the MCP client to pass a valid Truto API token in theAuthorizationheader, ensuring only authenticated internal systems can utilize the server. - Automatic Expiration (
expires_at): You can generate ephemeral servers with strict time-to-live timestamps. This is ideal for giving an automated agent temporary access to deploy a specific feature branch before automatically revoking access.
Orchestrating Infrastructure with Natural Language
Connecting Vercel to Claude replaces brittle automation scripts and manual dashboard navigation with intent-driven operations. Instead of maintaining custom Python scripts to rotate environment variables or audit DNS records, your DevOps team can interact directly with Vercel's capabilities through natural conversation.
By leveraging Truto's dynamic MCP server generation, you eliminate the technical debt of building and hosting an integration layer. Truto handles the schema translation and passes rate limit data directly to the LLM, giving you a resilient, production-ready link between your AI agents and your cloud infrastructure.