Skip to main content

Building with an AI editor

sitepack mcp turns the site you are developing into a live workspace for an AI editor. While sitepack theme:watch is syncing your theme, the MCP server lets an agent fill in the design you are building: create pages, put them in a menu, and manage the online store's categories and products, then check that what it built actually renders.

It speaks the Model Context Protocol, so any MCP client (Claude Code, Cursor, and others) can drive it.

How it works

sitepack theme:watch already knows which site you are building on: it asks you to pick one when it starts. On top of that it now requests a token from SitePack that is scoped to that one site, and stores it locally. sitepack mcp reads that token and serves it to your editor.

The two commands run side by side: the watch keeps your theme in sync in one terminal, and your editor starts the MCP server on its own. Nothing listens on a network port; the server talks to the editor over standard input and output, and the token never leaves your machine.

The token is bound to the single site you picked and lasts a working day (8 hours). Start theme:watch again to refresh it.

Setup

  1. Log in, if you have not already:

    sitepack login
  2. In your theme directory, start the watch and pick the site to build on:

    sitepack theme:watch
  3. Point your editor at the MCP server. For Claude Code:

    claude mcp add sitepack -- sitepack mcp

    Any MCP client works; the command to run is sitepack mcp, with the theme directory as its working directory.

If you started your editor somewhere other than the theme directory, sitepack mcp falls back to the most recent watch session. When several watches are running, pass --theme <uuid> to choose one.

Staging by default, live on request

Pages the agent creates default to staging: they are served only by staging-<your-domain> and are invisible to visitors, which is the safe way to build on a site that already has traffic. The agent can publish a page when you ask it to; that is a choice made per page, so nothing goes live by accident. A menu entry that points at a staging page stays hidden on the live site until that page is published.

The online store has no staging: categories and products the agent creates are written to the live shop straight away, so only ask it to create ones that are meant to be seen.

What the agent can do

The MCP server exposes a focused set of tools:

AreaTools
Contextsite_context
Pageslist_pages, get_page, create_page, update_page, set_page_elements, check_slug, delete_page
Navigationlist_navigation, add_navigation_item, update_navigation_item, remove_navigation_item
Categorieslist_categories, get_category, create_category, update_category, delete_category
Productslist_products, get_product, create_product, update_product, delete_product
Media and checkslist_media, check_page_render

site_context is the one to call first: it reports which site the session points at, the staging URL, and the scopes the session holds. After building a page, check_page_render fetches it over HTTP and reports any Twig or PHP error in the response, because a page the API accepted is not always a page that renders.