Skip to content
Start free

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.

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:

Terminal window
export YOYO_TOKEN=yoyo_...

Give the agent its own token rather than reusing your CLI token, so you can revoke it on its own.

Terminal window
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.

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}"
}
}
}
}

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}"
}
}
}
}

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>.

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.

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, .tsx and .jsx files 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.md is served as a page at / and notes.md at /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: true to keep one to yourself; that needs Pro.

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.

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.

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.