Skip to main content
A type-safe API client for the Vercel Platform API, auto-generated from the official OpenAPI specification with full TypeScript support and MCP integration.

Features

  • Type-Safe - Full TypeScript support with auto-generated types from OpenAPI spec
  • Zod Schemas - Runtime validation with Zod schemas for all API types
  • MCP Support - Model Context Protocol integration for AI assistants
  • Auto-Updated - Daily regeneration from upstream OpenAPI specs

Installation

pnpm add vercel-api-js

Usage

Basic Usage

import { createClient } from "vercel-api-js";

const client = createClient({
  baseUrl: "https://api.vercel.com",
  headers: {
    Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
  },
});

// List all projects
const projects = await client.getProjects();

// Get a specific project
const project = await client.getProject({ idOrName: "my-project" });

// Create a new deployment
const deployment = await client.createDeployment({
  name: "my-project",
  target: "production",
});

With Fetchers API

import { Fetchers } from "vercel-api-js";

// Use individual fetchers for specific endpoints
const projects = await Fetchers.getProjects({
  config: {
    headers: { Authorization: `Bearer ${token}` },
  },
});

Type Exports

import type { Types } from "vercel-api-js";

// Use TypeScript types
type Project = Types.GetProjectResponseBody;
type Deployment = Types.CreateDeploymentResponseBody;

Zod Schemas

import { Schemas } from "vercel-api-js";

// Validate API responses
const projectSchema = Schemas.getProjectResponseBody;
const validated = projectSchema.parse(response);

MCP Integration

The package includes MCP (Model Context Protocol) support for AI assistants.

Remote MCP Server

Add to your MCP client configuration:
{
  "mcpServers": {
    "vercel": {
      "url": "https://openapi.sferadev.com/api/vercel/mcp"
    }
  }
}

Local MCP Server

import { initMcpTools } from "vercel-api-js/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

const server = new McpServer({ name: "vercel" });

initMcpTools(server, {
  baseUrl: "https://api.vercel.com",
  headers: {
    Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
  },
});

API Reference

The client exposes all Vercel API endpoints including:
  • Projects - Create, list, update, and delete projects
  • Deployments - Manage deployments and rollbacks
  • Domains - Configure custom domains
  • Environment Variables - Manage env vars across environments
  • Teams - Team and member management
  • Edge Config - Edge configuration management
  • And more…
For the complete API reference, see the Vercel REST API documentation.