Publish from an AI agent (MCP)
Yoyo runs a Model Context Protocol server, so an AI agent can publish a page or a small static site and hand you back a live URL — no CLI, no copy-paste.
Ask your agent for “a landing page for my coffee cart, published to Yoyo”
and it comes back with https://coffee-cart-you.yoyo.codes. Ask it to “make
the header blue” and the same URL updates.
| Server URL | https://api.yoyo.codes/mcp |
| Transport | Streamable HTTP |
| Auth | Authorization: Bearer yoyo_… |
| Plans | Every plan, including Free |
The server has six tools: publish, update, snapshot, list, show and read. See the MCP tools reference for what each one takes and returns.
1. Create an API token
Section titled “1. Create an API token”In Yoyo, open Settings → API Tokens and create a token. It starts with
yoyo_ and is shown once, so copy it somewhere safe. The examples below read it
from a YOYO_TOKEN environment variable:
export YOYO_TOKEN=yoyo_...Give the agent its own token rather than reusing your CLI token, so you can revoke it on its own.
2. Add Yoyo to your agent
Section titled “2. Add Yoyo to your agent”Claude Code
Section titled “Claude Code”claude mcp add --transport http --scope user yoyo https://api.yoyo.codes/mcp \ --header "Authorization: Bearer $YOYO_TOKEN"--scope user makes Yoyo available in every project. Leave it out to add it
to the current project only. Run /mcp inside Claude Code to check that
yoyo is connected.
Cursor
Section titled “Cursor”Add Yoyo to ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one
project):
{ "mcpServers": { "yoyo": { "url": "https://api.yoyo.codes/mcp", "headers": { "Authorization": "Bearer ${env:YOYO_TOKEN}" } } }}VS Code
Section titled “VS Code”Add Yoyo to .vscode/mcp.json. VS Code asks for the token the first time and
stores it securely:
{ "inputs": [ { "type": "promptString", "id": "yoyo-token", "description": "Yoyo API token (yoyo_...)", "password": true } ], "servers": { "yoyo": { "type": "http", "url": "https://api.yoyo.codes/mcp", "headers": { "Authorization": "Bearer ${input:yoyo-token}" } } }}Other clients
Section titled “Other clients”Any MCP client that speaks Streamable HTTP and can send a custom header works.
Point it at https://api.yoyo.codes/mcp and send
Authorization: Bearer <your token>.
3. Try it
Section titled “3. Try it”Start a new conversation and ask for something small:
- “Make a one-page countdown to New Year’s and publish it to Yoyo.”
- “Write up these meeting notes as a Markdown page on Yoyo.”
- “Change the background on my countdown page to dark blue.”
- “Snapshot it so I have a link that won’t change.”
The agent gets back the live URL, a link to the project in the Yoyo editor,
and warnings about anything that might stop the page working, such as a
missing index.html or a .tsx file nothing will compile.
How agents should write for Yoyo
Section titled “How agents should write for Yoyo”The server tells connected agents this up front, but it’s worth knowing if a result looks wrong:
- Files are served exactly as sent. There’s no build step and no
npm install, and.ts,.tsxand.jsxfiles aren’t compiled. Use plain JavaScript modules, load libraries from a CDN through an import map, and use htm instead of JSX. See Using frameworks. - Markdown is rendered.
index.mdis served as a page at/andnotes.mdat/notes. See Markdown pages. - Text files only. Tools take file contents as text, so an agent can’t upload images or other binary files. Link to images hosted elsewhere, use SVG, or upload them in the editor.
- Projects are public. Anyone with the URL can see them. Pass
private: trueto keep one to yourself; that needs Pro.
What an agent can and can’t do
Section titled “What an agent can and can’t do”Through MCP an agent can create projects, change their files, take snapshots, and read your projects and files. It can’t delete a project, change its visibility after it’s created, or touch your account settings: there are no tools for those.
The token itself is a full API token, though, so treat it like a password. Revoke it in Settings → API Tokens when you stop using it.
Limits are the same as everywhere else in Yoyo: file size and storage follow
your plan, and each token can make 120 requests
a minute. Projects created with an API token, whether through MCP, the CLI or
the API, are capped at 20 an hour and 100 a day per account. Changing an
existing project with yoyo_update doesn’t count.
Troubleshooting
Section titled “Troubleshooting”401 “Missing API token” or “Only Yoyo API tokens work here”. The header
didn’t arrive, or isn’t a yoyo_ token. Check that the header is exactly
Authorization: Bearer yoyo_… and that the environment variable is set in
the shell your agent was started from.
401 with a valid-looking token. The token was revoked or mistyped. Create a new one.
429. The token went over 120 requests a minute. Wait a minute; the agent can retry.
“You can create 20 projects an hour with an API token”. Your account created 20 projects with a
token in the last hour, or 100 today. The message says when the limit resets.
Ask the agent to update an existing project with yoyo_update instead.
“Finish setting up your Yoyo account”. Pick a username at yoyo.codes first. Project URLs are built from it.
The agent says it published but the page looks wrong. Check the
warnings in the tool result, or ask the agent to read them back. Most
problems are files that need a build step.
Prefer a shell?
Section titled “Prefer a shell?”Coding agents that can run commands can also use the
yoyo CLI: yoyo deploy --json publishes a whole folder,
including images, without the model retyping every file.