Build a site with your AI agent
Behio Code lets ChatGPT, Codex, Claude, Cursor or any other MCP client write the code of your website or e-shop while Behio hosts it, builds it and runs the shop behind it.
Behio Code is a separate MCP server made for one job: letting an AI agent build and run a site on Behio. The agent writes the code. Behio gives it a repository, a live preview, hosting, a custom domain and the whole business backend (catalog, cart, checkout, payments, forms, blog, data collections), so there is no database or server for the agent to set up.
The server address is:
https://be.behio.com/mcp-codeIt carries 82 tools: the site tools listed below plus the catalog, forms, data collections, blog,
analytics and orders, so the same conversation that writes the product page can
also create the products. For everything else in your Behio account (warehouse,
invoicing, CRM) connect the full server at https://be.behio.com/mcp, see
Connect your AI assistant.
Connect
Every client signs in the same way: it opens Behio in your browser, you sign in and click Allow. No key to copy. If you do not have an organization yet, the agent can create one for you right in the chat.
ChatGPT
- Open Settings, then Connectors, and choose Create.
- Name it
Behio Codeand pastehttps://be.behio.com/mcp-code. - Pick OAuth, confirm, and approve the connection in Behio.
Custom connectors need a ChatGPT Plus, Pro, Business or Enterprise plan.
Codex
codex mcp add behio-code --url https://be.behio.com/mcp-code
codex mcp login behio-codeClaude
In Claude web or desktop: Settings, Connectors, Add custom connector,
URL https://be.behio.com/mcp-code. In Claude Code:
claude mcp add --transport http behio-code https://be.behio.com/mcp-codeThen run /mcp and pick Authenticate.
Cursor and other clients
Add the server to .cursor/mcp.json (or your client's MCP config):
{
"mcpServers": {
"behio-code": {
"url": "https://be.behio.com/mcp-code"
}
}
}A client that cannot do OAuth sends a personal access key in the X-MCP-Token
header instead. Create the key in the admin under AI and MCP, Access keys.
Plan first
A good agent does not build from a one line wish. Before it creates anything it
reads the start guide and acts as your web and e-commerce consultant: it asks
which organization the site belongs to (when you have more than one), what your
business does, what the site is for and whether you want to sell online, what
you sell (variants, prices, delivery, payments), which pages and content you
have, and whether you want visitor analytics. Then it recommends what Behio
already does for you (categories, variants, parameters, product groups, forms
that land in your CRM, data collections, a blog), writes a short plan with a
phone layout of the key pages, and waits for your yes.
site-create refuses to run without that agreed brief: the goal, whether the
site sells, analytics, the pages and the plan you confirmed. Everything is
built phone first, at 390 px, then widened and checked with screenshots at
390 and 1280 px.
Pick a starting point
A website and an e-shop are one thing on Behio, a site. site-templates-list
shows what a new site can start from, and the agent shows you live demos of the
two or three that fit before you choose.
| Starting point | What you get | Good for |
|---|---|---|
vite (default) | React, Vite, Tailwind and React Router with the Behio SDK and its React provider ready, served as static files | Most websites, landing pages and shops |
next | Blank Next.js app with the Behio SDK | Server rendering per page, large catalogs, heavy SEO |
| Behio templates | Finished designs, free or bought by your organization. Shop templates bring catalog, cart and checkout pages | A polished look on day one |
Templates your organization bought are listed separately and recommended first.
Paid templates are bought in the admin. A website on the vite starter also gets
a contact form on Behio, so form submissions land in your admin from the first
deploy.
Selling
Selling is a switch on the site, not a second project. When you want to sell
from the start, the agent creates the site with brief.sells set and the shop
exists right away. A site that started as a website gets the shop later with
site-commerce-enable: catalog, cart, checkout, orders and invoices are added,
while the domain, pages, forms and blog stay where they are. Either way the
shop's eshopId for the eshop-* tools is the same as the siteId, and a shop
always has Behio Analytics on (a plain website only when you want it).
How the agent works on a site
The agent never touches the live site directly. It works on a draft, you look at the preview, and the draft goes live only when you say so.
- Read.
site-getwith the briefing, thensite-files-list,site-files-grepandsite-file-readto find what to change. - Write.
site-files-writesaves any number of new files, partial edits and deletions as one commit. Partial edits replace an exact piece of text, so the agent does not resend a whole file to change one line. - Check.
site-checkvalidates syntax, JSON and imports in a few seconds, before any build runs. A write with a syntax error is refused and nothing is committed. - Run it.
site-runinstalls, typechecks, lints or builds the exact draft in an isolated sandbox in about a minute, so broken builds are caught before any deploy. - See it.
site-dev-previewstarts an instant preview with hot reload: every later write shows up within seconds.site-screenshotlets the agent look at a page (desktop or phone width) and fix what looks wrong. The regular preview (site-preview) rebuilds 2 to 4 minutes after each commit, andsite-logsshows its build output, with secrets masked. - Go live.
site-publishpublishes the draft, but only after you ask for it. A brand new site goes live by connecting a domain withsite-domain-connect;site-domain-statusfollows DNS and the certificate.
Building sites for clients? Finish one, then site-duplicate copies its code into
a new site with its own preview and history, ready for the next client's texts and
branding.
Started with a website and want to sell? site-commerce-enable adds the shop to
the same site, nothing moves (see Selling). The agent then fills the
catalog and sets up payments with the eshop-* tools, and the site
rebuilds with a cart in a few minutes.
Changed your mind? site-history lists every commit, including changes made in
the Behio admin editor, and site-revert resets the draft to any of them. The
live site stays as it was.
Content and media
site-media-uploadimports an image, video or PDF from a public URL (up to 10 MB) into the site's media library and returns a permanent URL for the code. Binary files never go into the repository.- Products, categories, descriptions and product photos go through the catalog
tools (
eshop-product-create,eshop-product-locale-upsert,eshop-product-image-add). An image added by URL is copied into Behio storage, so it keeps working when the original disappears. The agent also sets up the catalog structure from the plan: variants with their own price, stock and photo, parameters for specifications and filters, product groups for "similar" and "upsell" blocks, category order, labels and discount codes. - Content of every site, a website without a shop included, takes the
siteIdand lives in Behio, so the owner edits it later in the admin without a deploy: text pages with their SEO (site-page-create,site-page-update), header and footer menus (site-menu-create,site-menu-item-create), site SEO per language (site-seo-upsert), measurement and verification scripts such as GA4, Tag Manager, Meta Pixel and Search Console (site-script-upsert), forms, blogs and data collections. In the Behio Code app for ChatGPT pages, menus, SEO and scripts aresite-pages,site-menus,site-seoandsite-scripts, each with an action parameter. site-guidegives the agent the exact SDK calls for a capability before it writes it: start (planning), content (pages, menus, SEO, scripts), commerce, catalog, cart and checkout, forms, data collections, blog, analytics, SEO, languages, design, media, deploy and Vite.- Repeated content the owner will edit later (team, references, FAQ, price
list, listings) goes into a data collection:
collection-create-updatedefines the fields,collection-item-upsertadds up to 100 items per call, and the site reads them withclient.collections.get(slug). The owner then edits them in the admin or the mobile app without touching the code.
Get the shop ready to sell
Ask the agent what is still missing and it reads the shop checklist
(eshop-onboarding-get). From the chat it can set up payments: card payments by
connecting your own Stripe account through a link, bank transfer and cash on
delivery. Legal pages (terms, complaints, privacy, withdrawal, cookies) are
yours: Behio does not write legal texts through AI assistants and does not
vouch for them. You prepare them in the admin (a shop has a legal documents
wizard on its Pages screen); a finished text you give the agent can become
a page linked from the footer menu. Shipping methods and carriers, payment
gateways that need secret keys and everything else the agent cannot do are set
up in the admin: the agent calls site-admin-link and gives you the exact page,
and never asks for keys or passwords in the chat.
What the agent cannot change
Some files stay under Behio's control so a build can never leak secrets or break
the hosting: .env files, .git and .github, Dockerfile, lockfiles,
.npmrc and .yarnrc, node_modules and build output. package.json can be
changed in a repository without a lockfile. Where a lockfile exists, the tool
says so instead of saving a change the build could not install.
The footer of every starter shows a small "Powered by Behio" badge
(PoweredByBehio). On the Free plan Behio deploys the site with
BEHIO_POWERED_BY=required and the badge has to stay; site-check reports a
missing one as an error. With a paid plan it is optional, and the agent
removes it when you ask. A plan change rebuilds the site on its own.
See what happened and how long it took
Every tool call is recorded with a timeline: how long the GitHub calls, the git commit, the build service, AI and storage took, and what was left for the database. Open AI and MCP in the admin (web, iPhone or iPad), pick the connection or key, and you see the slowest tools first and each call step by step. Each change the agent makes also appears in the site's editor history with the name of the client that made it.