Skip to main content

Use Copera Designs with Your Coding Agent

Design an app, dashboard, or set of pages as an artifact in Copera, then hand it to your coding agent to build for real. Claude Code, Codex, OpenCode, and Cursor connect to Copera MCP Cloud and read everything they need with a single tool call: get_artifact_handoff.

What your agent receives​

get_artifact_handoff returns the whole artifact in one read:

PartWhat it contains
SpecThe artifact's Spec — what it is for, who uses it, and how it should behave.
NotesThe notes people pinned to pages or to the Spec.
DesignThe shared design: guidance, tokens, and components files, plus logos, fonts, and images with short-lived download links.
PagesEvery page with its surface, viewport size, entry file, and the files it loads.
LinksHow the pages link to each other (the flows between screens).
Source filesThe artifact's source, with file contents included.

Set it up​

Create a token with Drive access

Coding agents that run on your computer connect with a Personal Access Token. In Copera, open Workspace Settings → Integrations, create a Personal Access Token, and give it Drive access (the access_drive scope). Copy the token (cp_pat_…) — treat it like a password. See Authentication for details.

Add Copera to your coding agent

Replace <YOUR_TOKEN> with your token. These are the same lines Copera shows in an artifact's Export → Build it with your coding agent menu.

Run in your terminal:

claude mcp add --transport http copera https://mcp.copera.ai/mcp --header "Authorization: Bearer <YOUR_TOKEN>"

Restart or reload the agent so it picks up the copera server.

Ask your agent to build it

Copy the prompt from the same Export menu and send it to your agent:

Build the <artifact name> artifact from Copera

Add anything about your stack, for example "as a Next.js app with Tailwind". The agent finds the artifact with list_artifacts, calls get_artifact_handoff, and builds from the result.

How the agent builds​

get_artifact_handoff tells the agent what to do next, in this order:

  1. Read the Spec — the intent, the people who use it, and the rules.
  2. Read the notes — feedback and decisions pinned to pages.
  3. Set up the design — tokens, components, fonts, logos, and images first, so every page shares them.
  4. Build each page from its files, at its surface and viewport size.
  5. Wire the links between pages so the flows work.

By default the agent gets the latest version of the artifact that built successfully. To build a specific version, pass its versionId (find it with list_artifact_versions).

Large artifacts

To keep tool results small, file contents are included up to 32 KiB by default. Larger files come back marked omitted: "over_budget", and the agent reads them with read_artifact_source. If your client accepts large tool results, the agent can raise maxInlineBytes (up to 1 MiB).

Keep your token out of source control

opencode.json and .cursor/mcp.json often live inside a project. If you paste your token there, do not commit the file. Rotate the token in Workspace Settings → Integrations if it ever leaks.

Troubleshooting​

SymptomLikely cause
401 UnauthorizedThe token is missing, mistyped, or expired. Check the Authorization: Bearer … value.
403 Forbidden on an artifact toolThe token lacks Drive access (access_drive), or Artifacts isn't available in your workspace.
The artifact isn't foundThe token's user can't open that artifact. Ask its owner to share it with you.
The agent asks you to sign inIt's trying to connect without your token. Re-check the setup line from step 2.