Connect Claude to Libretto

Set up Claude Code on your computer so it edits your Libretto site for you, from the invite email to your first change, and learn what it may and may not do.

Updated

Claude Code can change your Libretto site for you: texts, sections, images, menus, the design system. You set it up once: accept the invite, make a token in the admin, install the Libretto plugin in Claude Code and give it the token. It takes about 15 minutes. Claude's changes land in the draft, the version of the site only signed-in people see, and the public site changes only when you say "publish".

Before you start #

You need four things.

  • The invite email from Libretto, or the invite link the team sent you. Skip step 1 if you already sign in to the admin.
  • Claude Code installed on your computer: see code.claude.com/docs. You start it by typing claude in a terminal; the commands below that begin with / are typed at its prompt, and /exit quits it.
  • Node.js 18 or later. The plugin's image uploader, libretto-files, runs on it. To check, run node --version in a terminal: it must print v18 or a higher number. If the command is missing or older, install the LTS (long-term support) version from nodejs.org.
  • About 15 minutes, and the admin open in your browser.

Step 1: accept the invite and choose a password #

The invite is a link. It works once, for 7 days.

  1. Open the link in the invite email.
  2. The page Choose your password opens. It says who invited you, to which workspace, and which email your account is. Type a password of at least 8 characters in Password, and again in Confirm password.
  3. Choose Set password and sign in. The admin opens on the home of the website you were invited for; if the invite named none, on the first website of your workspace.

From then on you sign in at librettocms.com/admin. If the link says This invitation link is not valid or has expired, ask the person who invited you for a new one. More detail: Request access.

Step 2: find your workspace and site #

The workspace holds your studio's websites. The left column shows where you are, under Current site.

  • Workspace names your studio's workspace.
  • Website names the site you are on. Click it: a list of every website you can reach opens. Pick the one you want.
  • As the workspace owner you reach every website of the workspace, including ones added later.

Note the name of the site you want Claude to work on: a token is for one site.

Step 3: make a token #

A token is a long secret code that lets Claude act for you, on one site, with your role. You make it in the admin and copy it once.

  1. In the sidebar, open People & access › Agents & MCP access. MCP is the way Claude Code talks to Libretto.
  2. Under New token, fill in:
    • Name: where it will live, for example Claude Code, studio laptop.
    • Website: the site Claude should edit.
    • Expires after: 90 days (the default) or 30 days.
  3. Choose Create token.
  4. The screen shows Token “…” is ready. Choose Copy token and keep it somewhere safe for step 4, such as your password manager. The screen shows it only this once.
  5. Below it, Connect your client opens on the Claude Code plugin: the two commands of step 4, and the address to give it. The other tabs are for a client without the plugin; with the plugin you need none of them, and adding both would connect Claude to Libretto twice.
  6. Choose I've saved the token. The token is listed under Your tokens, with its site and expiry date.

Never paste the token into a chat, an email or a file in a project folder. If you lose it, revoke it and make a new one (see Revoke a token). To work on another site, make a token for that site and set it with /plugin configure libretto@libretti (step 4): Claude then works on that site.

Step 4: install the Libretto plugin #

The plugin is an add-on for Claude Code: it connects Claude to Libretto and teaches it how to work there. A marketplace is the list a plugin is published in: Libretto's is called libretti, so in libretto@libretti the name before the @ is the plugin and the name after it is the marketplace. The plugin's code and README are public at github.com/InnestiDigital/libretto-plugins. Start Claude Code and type these at its prompt, one at a time.

  1. Add the Libretto marketplace:
    /plugin marketplace add InnestiDigital/libretto-plugins
  2. Install the plugin:
    /plugin install libretto@libretti
  3. Claude Code asks for the plugin's settings:
    • Token del sito Libretto / Libretto site token: paste the token from step 3. Claude Code keeps it in your computer's secure storage (the keychain), never in a file.
    • Indirizzo di Libretto / Libretto address: leave https://librettocms.com as it is.
  4. If Claude Code did not ask, type /plugin configure libretto@libretti and fill in the token there.
  5. Type /exit, then start Claude Code again with claude, so it connects with the token.

Instead: the token in an environment variable #

An environment variable is a setting your terminal passes to the programs it starts. Use it only on a computer where you cannot use the plugin settings, or in scripts: on Linux and Windows the token is then written in plain text in your user settings. Install the plugin as in step 4, leave Token del sito Libretto / Libretto site token empty, then set LIBRETTO_MCP_TOKEN. A token in this variable wins over the plugin setting.

  • macOS: keep the token in the Keychain and read it from there.
    security add-generic-password -a "$USER" -s libretto-mcp-token -w
    echo 'export LIBRETTO_MCP_TOKEN="$(security find-generic-password -s libretto-mcp-token -w)"' >> ~/.zshrc

    The first command asks for the token, then asks again to confirm it: paste it both times and press Enter.

  • Linux: replace <token> with your token, keeping the quotes.
    echo 'export LIBRETTO_MCP_TOKEN="<token>"' >> ~/.bashrc
  • Windows (PowerShell): replace <token>, keeping the quotes, then close and reopen PowerShell.
    [Environment]::SetEnvironmentVariable("LIBRETTO_MCP_TOKEN", "<token>", "User")

Then open a new terminal and start Claude Code from it.

To replace the token later, on Linux delete the old line in ~/.bashrc and run the command again, and on Windows run the command again. On macOS run this (-U overwrites the old token):

security add-generic-password -U -a "$USER" -s libretto-mcp-token -w

Then open a new terminal.

In the Claude desktop app #

The plugin works the same in the Claude desktop app, but the app reads the token only from the plugin settings. An environment variable set in ~/.zshrc or ~/.bashrc does not reach an app you open from the Dock, Finder or the Start menu: it is for Claude Code started from a terminal.

  • In the app, type /plugin, choose libretto, then Configure, and paste the token in Token del sito Libretto / Libretto site token.
  • Or, in a terminal, run claude plugin configure libretto@libretti --values-stdin, paste {"libretto_token":"<token>"} and press Ctrl-D.

Then start a new session in the app.

Step 5: check the connection #

Claude Code lists its connections with one command.

  1. At Claude Code's prompt, type /mcp.
  2. The Libretto plugin adds two servers, and both show as connected: plugin:libretto:libretto, which reaches your site, and plugin:libretto:libretto-files, which uploads files from your computer.
What /mcp showsWhat it meansWhat to do
Both connectedReadyGo to step 6
libretto failed, with HTTP 401 or 403Libretto refused the token, and its message says why: no token, not a Libretto token, unknown (wrong, or made before your Libretto was reset), revoked or expired (401), or you can no longer work on the site (403: ask the workspace owner first)Make a new token in Persone e accessi › Agenti e accessi MCP (step 3), replace it in the plugin settings (/plugin configure libretto@libretti, or /plugin › libretto › Configure in the desktop app) and start a new session. If you use the environment variable in a terminal, replace the token there: it wins
libretto-files failedNode.js is missing or older than 18Install Node.js (see Before you start), then restart Claude Code
No Libretto serverThe plugin is not installed or not enabledDo step 4 again

Step 6: your first change #

Ask in your own words, and name the page. Claude first tries each change without saving it (a dry run), then applies it. For example:

Use Libretto: on the Servizi page, change the heading of the "Restauro" section to "Restauro conservativo".
Dry run first, show me what changes, and apply only if it is clean. Do not publish.

Claude reads the page, does the dry run, applies the change and checks the result. It tells you what changed and gives a requestId, the receipt of that change. To see it, choose Edit website on the site's home in the admin.

  • To undo, say "undo that" in the same conversation; in a later one, give Claude the requestId, so keep it. Libretto refuses an undo when a later change touched the same thing: undo the later one first.
  • To add a picture, name the file on your computer: "put ~/Desktop/courtyard.jpg in the Restauro section" (on Windows, a path such as C:\Users\you\Desktop\courtyard.jpg). Claude uploads it to Media and writes its alternative text. JPEG, PNG, GIF, WebP and SVG pictures are accepted, up to 5 MB: Claude shrinks a larger picture first or tells you.
  • To use a font file, name the WOFF2 files on your computer and the licence you hold them under. Claude uploads each weight and style to the site's fonts and points the type at the family.

Optional: let Claude use your Chrome #

With the Claude in Chrome extension, Claude can also look at your site in your own browser and do the few admin jobs the plugin has no operation for. Nothing else in this page needs it.

  • What it adds: before-and-after screenshots of the draft and of the public page at desktop and phone width; uploading font files on Design system › Typography when the plugin cannot upload them itself; publishing from Publish & versions when you ask for it there.
  • Your session stays yours: Claude opens its own tabs in the Chrome where you are signed in to the admin. It never types your email or password; if it reaches the sign-in page, it stops and asks you to sign in.
  • When the plugin uses it: only for what the Libretto connection cannot do, and to check what a visitor sees. Every other change goes through the plugin, with its dry run and undo. Claude publishes or deletes in the admin only when you say so.
  • Set up: install the Claude in Chrome extension, start Claude Code with claude --chrome (or type /chrome and choose Enabled by default), and sign in to the admin in that Chrome. See Use Claude Code with Chrome.

What Claude can do, by role #

Claude never does more than you could do yourself in the admin. The token takes your role on its one site, and if your role is lowered later the token narrows at once.

Your roleOn the token's site, Claude canClaude cannot
Workspace ownerEverything a Content editor can, plus the whole design system (colours, type, spacing, component looks, themes), creating and deleting pages, editing the layouts, and making an earlier version live againChange the site's languages or domains
Content editorEdit pages, sections, texts, images, menus, collections (repeated content such as projects or team members) and motion; change the parts of the design system the site leaves to editors; publishEverything the owner cannot, plus creating or deleting pages, editing the layouts and making an earlier version live
Super admin (the Libretto platform team)EverythingNothing is held back
Content author, Read-only viewer, Brand clientNo token: these roles cannot connect Claude

The limits are the same in the admin: for a language or a domain, ask the Libretto team; a Content editor asks the workspace owner for a new page. When Claude meets a limit, it tells you what is missing and who can do it. If Libretto refuses something that looks right, or lacks a feature you need, Claude opens a report for the Libretto team and gives you its number.

Publishing stays your call #

Claude publishes only when you say so in the conversation. A request to edit is never a request to publish, and Claude cannot publish later on its own: come back and say "publish" when you are ready.

  • Before publishing, Claude lists what it changed and asks "Publish these changes now?".
  • A publish puts every pending change of the site live, yours and other people's. Publish & versions in the admin's left column shows them all; Claude sees only its own, so look there first if others work on the site.
  • A page whose status is draft stays off the public site even after a publish.
  • To go back after a publish, the workspace owner or a Super admin chooses Make live on an earlier version in Publish & versions, or asks Claude to restore the version it published before. A Content editor asks the owner. Making an earlier version live also replaces the draft: changes not yet published are lost.

Revoke a token #

Revoke a token when a computer is lost or stolen, a project ends, or you are not sure where the token went.

  1. In the sidebar, open People & access › Agents & MCP access.
  2. Under Your tokens, choose Revoke next to the token, then Revoke token.

Every client that uses it loses access to the site at once, and it cannot be undone. A token also stops working when it expires or when you lose access to its site. Then clean up the computer, if you still have it:

  • Remove the plugin: /plugin uninstall libretto@libretti, then /plugin marketplace remove libretti (the marketplace you added in step 4 is named libretti). This also removes the token from the plugin settings.
  • If you used the environment variable, delete its line from ~/.zshrc or ~/.bashrc. On macOS also delete the Keychain entry; on Windows clear the variable:
    security delete-generic-password -s libretto-mcp-token
    [Environment]::SetEnvironmentVariable("LIBRETTO_MCP_TOKEN", $null, "User")

If the computer was stolen, also change your admin password: open your account menu (the round button with your initial, at the top right) and choose Change password.

Invite a colleague #

As the workspace owner you invite the people who work on your sites. Each person makes their own token: never share yours.

  1. In the sidebar, open People & access › People of the workspace. It lists everyone in the workspace with their role and websites.
  2. Choose Invite a person.
  3. Fill in Email, optionally Name, and Role: Content editor (pages, design and content), Content author (texts, images and collections) or Read-only viewer. Only a Content editor can connect Claude.
  4. Under Websites, tick the sites they should reach.
  5. Choose Invite. They get an email with a link to choose a password; the link works once, for 7 days. If the platform does not send email yet, the screen shows the Invite link: choose Copy link and send it yourself.

A Content editor then follows this page from step 1 to connect their own Claude. Other roles, and moving people between workspaces, are for a Super admin.

Pitfalls #

Pitfall: /plugin marketplace add fails. Check that the computer is online, update Claude Code with claude update in a terminal, then run it again.

  • The token screen is gone before you copied it. The token is not stored anywhere. Revoke it and make a new one.
  • "Your role cannot connect agents." Content authors, viewers and brand clients cannot make tokens. Ask the workspace owner for the Content editor role.
  • No site to choose under Website. You have no site yet. Ask the workspace owner to add you to one.
  • Claude says it may not change a part of the design system. On that site, that part belongs to the workspace owner. Ask the owner to make the change, or to ask their own Claude.
  • A change shows in the editor but not on the public site. Nothing is public until someone publishes.

Something wrong on this page? Write to docs@librettocms.com.

Libretto docs

Colophon. These docs are a Libretto site: 68 pages in two languages, 20 guide pages imported from Markdown and 41 reference pages generated from the operation registry. Set in Softcore, with code in IBM Plex Mono. Its outline:

/ Libretto docs /start Get started /start/request-access Request access /start/workspace Your workspace /start/first-site Your first site /start/invite-a-client Invite a client /start/connect-claude Connect Claude to Libretto /build Build /build/first-page Build a page /build/layers-and-canvas Layers and canvas /build/site-components Site components /design-system Design system /design-system/tokens Colours, space and themes /design-system/components Components and variants /design-system/fonts Typography and fonts /motion Motion /motion/scenes Scenes and recipes /motion/image-sequences Image sequences /motion/reduced-motion Reduced motion /publish Publish /publish/languages Site languages /publish/versions Publish and versions /publish/members-and-forms Members and forms /publish/domains Domains /handover Hand a site to a client /glossary Glossary /agents Agents and API /agents/mcp MCP server /agents/cli CLI /agents/batches Batches /agents/errors Errors and findings /agents/operations Operations /search Search