Morpha API
Morpha is an AI-driven video editor for short-form social video. You arrange layered elements — video clips, images, text, shapes — over a composition, animate them on a 30 fps keyframe timeline, and export an MP4. The editor runs in the browser; this site documents the programmatic API that drives the same projects from outside the editor.
What the API is for
Every project Morpha can edit in the browser, an external agent can edit over the network. The recommended way in is the npm SDK; beneath it are two raw protocol surfaces — all driving the same tool catalog:
- npm SDK (recommended) — `morpha-studio-sdk`, the friendliest way to drive Morpha from code.
createClient({ token })gives yougetProject/listTools/callTool/renderFrame/renderVideoagainst the hosted Worker — the same catalog as MCP, over the same HTTP endpoints, plus one-call PNG frame + MP4 video rendering (no ffmpeg, no server). It's a client of the API below, not a replacement for the MCP server. - MCP —
POST /mcp, a Model Context Protocol server. Point Claude Code, Claude Desktop, or any MCP client at it and the full tool catalog appears as callable tools. - HTTP —
GET /api/toolslists the catalog;POST /api/tool/<name>dispatches one tool. Plain JSON, good for curl, scripts, and CI. - Editor LLM panel — the same catalog, wired to the in-browser prompt panel. Not a network surface; mentioned here only because it shares the catalog.
They all call the same pure dispatch layer, so behaviour is identical whichever you use. A tool call loads the project from storage, applies the change, validates it against the schema, and writes it back.
The API is built for the work a person would never click through by hand: "place 50 stars at random positions, each with a staggered fade-in", "duplicate this layer 30 times in a circle", "recolour every shape along a gradient". One described instruction, hundreds of mutations.
Connecting with the SDK (recommended)
npm i morpha-studio-sdk
import { createClient } from "morpha-studio-sdk";
const morpha = createClient({ token: process.env.MORPHA_TOKEN }); // origin defaults to https://morphastudio.ai
const tools = await morpha.listTools();
const project = await morpha.getProject("your-project-id");
const { result, project: next, editorUrl } = await morpha.callTool(
"your-project-id",
"describe_video",
{},
);
createClient talks to the same Worker endpoints as MCP (GET /api/project/:id, GET /api/tools, POST /api/tool/:name); callTool does the load → dispatch → write round-trip server-side. It also renders a composited PNG frame with renderFrame, or the full composition to MP4 with renderVideo (no ffmpeg, no server — a real local browser does the encode). For local dev, createClient({ origin: "http://localhost:8787" }) needs no token. Full reference: the [SDK page](/docs/sdk).
Connecting over MCP
Add Morpha to your MCP client config:
{
"mcpServers": {
"morpha": {
"url": "https://morphastudio.ai/mcp",
"headers": {
"Authorization": "Bearer mp_your_api_key_here"
}
}
}
}
For local development against wrangler dev, point at http://localhost:8787/mcp — no auth header is needed in dev (ENVIRONMENT=development bypasses the auth gate).
Connecting over HTTP
The HTTP base URL is https://morphastudio.ai.
GET /api/tools— returns the full tool catalog as JSON (the sameTOOL_DEFINITIONSthe MCP server exposes).POST /api/tool/<name>— dispatch one tool. Body:{ "projectId": "<id>", "args": { ... } }. The worker loads the project from storage, runs the tool, and writes the result back when the tool reports success.
curl -X POST https://morphastudio.ai/api/tool/describe_video \
-H "Authorization: Bearer mp_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{ "projectId": "your-project-id", "args": {} }'
Authentication
The SDK, MCP, and HTTP all use the same credential: a bearer API key.
- Sign in to the editor at morphastudio.ai/app.
- Open `/app/settings` and mint an API key. It looks like
mp_…and is shown once — copy it immediately. - Use it:
createClient({ token: "mp_…" })with the SDK, or sendAuthorization: Bearer mp_…on every MCP or HTTP request.
Keys are revocable from the same settings page. Each key maps to your account, so a tool call sees exactly the projects you'd see in the editor. In local wrangler dev the auth gate is bypassed entirely — no key required (createClient({ origin: "http://localhost:8787" })).
Where to go next
- [SDK reference](/docs/sdk) — the recommended npm client:
createClient/callTool/renderFrame/renderVideo, plus the pure local dispatch catalog. - [Getting started](/docs/getting-started) — the describe-before-mutate workflow, element-id conventions, the coordinate system, frames vs seconds.
- [Tool reference](/docs/tools) — every tool, grouped, with signatures and worked examples.
- [Examples](/docs/examples) — end-to-end sessions you can adapt.
- [Common mistakes](/docs/common-mistakes) — the failure modes that trip up new agents.