Chocolate Factory Integration
Chocolate Factory lets you add an AI chat assistant to your published website, so visitors get answers from an AI agent.
This is different from connecting an AI tool, which lets your team work on the site through AI. Chocolate Factory is for your website’s visitors.
How it works
This is a manual integration. Visor doesn’t create anything in Chocolate Factory for you, or the other way round. You move between the two and copy the details across yourself.
| What you copy | Copy it from | Paste it into |
|---|---|---|
| The site’s MCP address and a personal token | Visor: Settings → AI tools | Chocolate Factory: the MCP server |
| The Chocolate Factory address | Chocolate Factory: the agent’s Integrations tab | Visor: Chocolate Factory Domain |
| An Agent API key | Chocolate Factory: the agent’s Integrations tab | Visor: Project API Key |
| The Agent ID | Chocolate Factory: the agent’s Integrations tab | Visor: Agents |
What you need
- A Chocolate Factory account, assigned to your site’s project.
- A role at the site that can save its frontend’s settings, usually Site Admin.
Set it up
In Chocolate Factory: sign in
Sign in to your Chocolate Factory. If you have forgotten your password, use Sign in with Magic Link. See Sign in to your account .

Choose your project from the project menu at the top of the page.

In Visor: get the connection details
The agent reads your site through the Visor MCP. Go to Settings → AI tools and create a personal token:
- Under what it may do, tick only See the site’s pages, content, content types and files.
- Under Expires after, choose how long it should last.
Copy the token, because it is shown once. Copy the site’s MCP address from Connect your AI tool as well:
https://<your-visor-address>/api/mcp/sites/<organization-id>/<site-id>In Chocolate Factory: add the MCP server
Click Database & Tools in the sidebar. On the MCP Servers tab, click Add MCP Server or Create, and choose Custom.

Fill in the form:
| Field | Value |
|---|---|
| Server Name | Something you’ll recognise, such as the site’s name. |
| Server URL | The site’s MCP address from Visor. |
| Authentication | Custom, with the header below. |
{ "Authorization": "Bearer <your personal token>" }Click Create. Chocolate Factory checks the connection and loads the server’s tools. If the server’s status isn’t healthy, check the address and the token.
In Chocolate Factory: create the agent
Click Agents in the sidebar, then Create Agent. Fill in its name, role, description and model, then use its Configuration tab to set how it should behave.
In Chocolate Factory: give the agent the MCP server
On the agent’s Tools tab, under MCP Servers, click Add MCP Server and choose your server. Expand Available Tools, turn on only the tools it needs to read your site, and save.

In Chocolate Factory: activate and test it
Turn on the Active switch beside the agent’s picture and save. Open Dashboard, choose the agent, and ask it something about your site.
In Chocolate Factory: copy the agent’s details
Open the agent’s Integrations tab.

Copy these three things:
| Copy | Where | Example |
|---|---|---|
| Agent ID | At the top of the tab. | 00000000-0000-0000-0000-000000000000 |
| The Chocolate Factory address | The start of Run API URL, up to but not including /api. | https://your-chocolate-factory.example.com |
| An Agent API key | Under Agent API Keys, enter a Key Name and click Add Key. It is shown once. | agk_... |
Use an Agent API key, never an organization key. The chat runs in visitors’ browsers, so they can see this key. An Agent API key only reaches this one agent. An organization key reaches every agent in your organization.
In Visor: connect the frontend
Go to Settings → Frontend and click Manage on your frontend. On the Settings tab, open Site Configuration and find Chocolate Factory Integration.

Turn on the switch, then fill in the card:
| Field | Paste |
|---|---|
| Chocolate Factory Domain | The Chocolate Factory address. An Open Dashboard button then appears. |
| Project API Key | The Agent API key. If an older site already has a key here, leave it. |
| Agents | Click Add Agent, paste the Agent ID, enter an Agent Name, and click Add. |
Click Save at the top of the page.
In Visor: add the chat to a page
Edit a page and drag Chocolate Factory Chat from the Widgets panel, in the Interactive category. In its settings, choose:
| Setting | Value |
|---|---|
| Frontend Site | Your frontend. This fills in the Chocolate Factory address and key. |
| Agent | The agent you added. |
| Chat Title, Welcome Message, Primary Color, Widget Position, Avatar URL | How the chat looks. |
If the widget isn’t in the panel, the site may be hiding the template’s widgets. See Layouts.
In Visor: publish and deploy
Publish the page, then Deploy. In Edit mode the widget only shows a summary of its settings. The real chat appears on the published page.
Keep it working
| If | Then |
|---|---|
| The personal token is about to expire | In Visor, create a new one. In Chocolate Factory, replace it on the MCP server. |
| The token’s owner leaves the site | Do the same, as someone who still works at the site. |
| The personal token has leaked | Disconnect it straight away, then create a new one. |
| The Agent API key is compromised | In Chocolate Factory, replace it on the agent’s Integrations tab. In Visor, paste the new one into Project API Key, save, and open the chat widget’s settings to choose Frontend Site again. Then publish the page and Deploy. |
| You want a different agent | Create the agent and its key, and repeat the Visor steps. A frontend holds one key, and an Agent API key reaches one agent, so a frontend serves one agent at a time. |
| You want to remove the chat | Turn off the switch, save and Deploy. The widget then shows nothing. |
The agent can read whatever the token’s owner can read at the site, which may include unpublished content. Visitors could get answers based on it. Create the token as someone whose access suits this, and test the agent before you publish the chat.
For developers
Chocolate Factory Chat is a sample widget in the site template. A developer or AI tool can adapt it with the template’s chocolate-factory-sdk skill. See Skills.
The widget reads its settings from the frontend’s configuration and shows nothing if the integration is turned off.