Skip to content

Set up Canopus with your assistant

If you code with an assistant, you do not read this documentation to wire Canopus up. You plug the assistant in once, then paste the prompt each step of the setup guide gives you. It works in your repository and in Canopus through the MCP server; you keep the clicks that are yours by design, and every approval.

How it works

The setup guide (the setup page of your project) shows each step with a "Do it with my assistant" button. The prompt it copies is filled with your project, never with a secret: when the assistant needs a key, the prompt names the environment variable you put it in.

The first moment is right after the payment. While Canopus writes your strategy, the screen creates a key for the assistant in one click (it reads, drafts and writes contacts, and sends no email), gives you the Claude Code command with that key in it, and one prompt that sets up measurement, the sending domain and your existing users. You read your strategy while it works.

The assistant works on a branch and never pushes or deploys: it tells you what to deploy.

Plug the assistant in

  1. Claude Code, in your SaaS repository

    Create an API key with the Read, Write drafts, Write contacts and Send product events permissions, put it in your environment as CANOPUS_API_KEY, then run the command below in the repository.

  2. Claude Desktop, claude.ai or another MCP client

    Add Canopus as a custom connector with the server address below, sign in and choose the SaaS. No key to copy.

  3. Check

    Ask your assistant anything about Canopus. The setup guide ticks the step on the first call.

claude mcp add --transport http canopus https://www.canopushq.io/api/mcp \
  --header "Authorization: Bearer $CANOPUS_API_KEY"

The order, and who does what

The steps come in the order in which the assistant finishes the most. A step marked "you, then the assistant" waits on a click of yours (a secret, a domain), then the assistant does the rest.

StepWhoWhat happens
StripeYouYou connect your account with a read-only key.
Your assistantYouYou run one command or add one connector.
The interviewThe assistantIt answers the questions your code and site answer, and corrects the product description. Available once a subscription covers the project.
MeasurementThe assistantIt issues the site key and puts the snippet on your public pages, away from signed-in customers.
The CRM webhookYou, then the assistantYou generate the secret; it writes the integration that sends sign-ups, activity and payments.
Activation and adoptionThe assistantIt proposes the moments where a user gets value, sends them from your server, and sets activation.
Sending domainYou, then the assistantYou add the domain; it reads the DNS records and publishes them if it can reach your DNS.
ContactsThe assistantIt brings your existing users into the CRM.
Transactional emailThe assistantIt moves your product emails to the Canopus API, the old sender kept behind a switch.
LogoYouYou check the logo at the top of your emails.
SurveyThe assistantIt writes the NPS survey; you switch it on.
A/B testThe assistantIt drafts a headline test; you start it.
Error trackingThe assistantIt points your Sentry SDK at Canopus, or installs one, and checks a test error arrived.

The prompts

Inside the product each prompt carries the name of your SaaS. They are written in English because a coding assistant reads them; the assistant answers you in your language.

Right after the payment: everything that does not wait on the strategy

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Set up Canopus for my SaaS while Canopus writes my strategy. Do the parts below in order. When one waits for a click of mine in Canopus, tell me which one and go on to the next part.

Part 1. Measurement.
1. Call set_up_site_measurement. It returns the snippet with the site key (public by design).
2. Put the snippet in the <head> of every public page, once, in the layout.
3. If the public site and the signed-in product are the same application, load the script only for visitors who are not signed in: the snippet has no identify() call, so otherwise every customer who opens the product counts as a visitor, every day.
4. On the actions that matter for growth on the public pages (starting a sign-up, choosing a plan), call window.canopus('name'), guarded in case window.canopus does not exist. Names start with a letter: letters, digits, _ . : - only.
5. Remove no other analytics tool.

Part 2. Sending domain.
1. Call get_sending_domain_status.
2. If no domain is added yet, tell me to add it in Canopus, Settings, Sending domain, and come back to this part when I say it is done.
3. Otherwise, publish the records it returns (name, type, value) exactly as given if you can reach my DNS provider from here, touching no other record; if you cannot, give me a table to copy.
4. If an SPF or DMARC record already exists on the same name, do not overwrite it: tell me, and show the merged value.

Part 3. Existing users.
1. Find where users live in this codebase (database, auth provider) and count them. Do not run anything yet.
2. If the CRM webhook is wired (CRM_WEBHOOK_SECRET in the environment), write a one-off script that sends user.created for each existing user, signed like the integration, with a stable event_id per user, in small batches. Show it to me and run it only when I confirm.
3. If it is not wired, tell me the webhook page in Canopus (CRM, Settings, Webhook) gives the secret and its own prompt. If there are fewer than fifty users, you may instead use upsert_contact for each, then search_contacts to check.
4. Never put the user list in this conversation.

To finish, give me in one short list: what you changed and on which branch, what I must deploy, and each click still waiting for me. After I deploy, call get_measurement_setup to check that the first page views arrive.
The next steps (activation, transactional email, survey, A/B test) have their own prompts in Canopus, on the Setup page. Reference: https://www.canopushq.io/en/docs/assistant

The interview

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Answer the Canopus onboarding interview for me, from what this repository and the public site actually show.

1. Call get_strategy_interview to see the questions in order and what is already answered.
2. Call get_product_profile. If the product description is wrong or incomplete, correct it with set_product_description.
3. For each unanswered question the code or the site truly answers (who it is for, the price, the main competitor, how people find it), call answer_onboarding_question.
4. Never invent: a question only I can answer (my goal, my budget, my numbers) stays empty.

End with the list of questions still waiting for me. Sending the answers and asking for the strategy stay on the Canopus screen.
Reference: https://www.canopushq.io/en/docs/onboarding

Measurement

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Install Canopus measurement in this repository.

1. Call set_up_site_measurement. It returns the snippet with the site key (public by design).
2. Put the snippet in the <head> of every public page, once, in the layout.
3. If the public site and the signed-in product are the same application, load the script only for visitors who are not signed in. The snippet has no identify() call: otherwise every customer who opens the product counts as a visitor, every day.
4. On the few actions that matter for growth on the public pages (starting a sign-up, choosing a plan), call window.canopus('name'), guarded in case window.canopus does not exist. Names start with a letter: letters, digits, _ . : - only.
5. Remove no other analytics tool.

Then call get_measurement_setup after I deploy, to check that the first page views arrive.
Reference: https://www.canopushq.io/en/docs/measurement

Activation and adoption

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Give Canopus my product's real usage, so activation and feature adoption mean something.

1. The server key is in the CANOPUS_API_KEY environment variable (scope events:write). If it is missing, stop and tell me to create one in Canopus, Settings, API.
2. Read the code and propose two or three moments where a user gets the value of the product (for example a first project created, a first import done). Wait for my choice before writing anything.
3. Send each chosen moment from the server to POST https://www.canopushq.io/api/v1/events, with my own user id as userId, the email, and a stable eventId so a retry never counts twice. Send in the background: a failure must never block the user.
4. From now on, each time a feature ships, send one server event named after it (snake_case), so Canopus can show its adoption without any setup.
5. Do not send user.created or activity this way: the CRM webhook already carries them.

Once events have arrived, call get_measurement_setup, then set_measurement_events to set the activation event I chose.
Reference: https://www.canopushq.io/en/docs/measurement

Sending domain DNS records

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Publish the DNS records of my Canopus sending domain.

1. Call get_sending_domain_status. It returns the records to publish (name, type, value), the transactional ones too when that stream is on.
2. If you can reach my DNS provider (its CLI or API in this environment), publish them exactly as given and touch no other record.
3. Otherwise, give me a table to copy: name, type, value.
4. If an SPF or DMARC record already exists on the same name, do not overwrite it: tell me, and show the merged value.

Call get_sending_domain_status again an hour later to tell me whether the domain is verified.

Existing users

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Bring my existing users into the Canopus CRM.

1. Find where users live in this codebase (database, auth provider) and count them. Do not run anything yet.
2. If the CRM webhook is wired (CRM_WEBHOOK_SECRET in the environment), write a one-off script that sends user.created for each existing user, signed like the integration, with a stable event_id per user so it can be run twice without duplicates, in small batches. Show it to me and run it only when I confirm.
3. If the webhook is not wired and there are fewer than fifty users, use upsert_contact for each, then search_contacts to check.
4. Never put the user list in this conversation.

Reference: https://www.canopushq.io/en/docs/crm

Transactional email

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Send my product's transactional emails (sign-up confirmation, password reset, receipts) through the Canopus email API.

1. Call get_sending_domain_status. The transactional stream must be verified; if it is not, stop and tell me to switch it on in Canopus, Settings, Sending domain.
2. The key is in the CANOPUS_API_KEY environment variable (scope transactional:send). If it is missing, stop and tell me to create one.
3. Replace the current sender behind one function, and keep the old provider behind a switch until I have checked a few real sends.
4. Change neither the content nor the recipients of any email.

Reference: https://www.canopushq.io/en/docs/email-api

NPS survey

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Write the NPS survey Canopus sends my customers, in my customers' language.

1. Read the canopus://tone resource and the product in this repository.
2. The question itself is standard and cannot change. Write only the subject and the opening line, short and in my tone, and save them with save_survey_draft (kind nps).
3. Do not switch it on: I read it and switch it on in Canopus.

A/B test

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Prepare an A/B test on the headline of my landing page.

1. Read the landing page in this repository and the live site.
2. Propose two alternative headlines, each true to what the product does, nothing invented. Wait for me to pick one.
3. Create the draft with create_experiment_draft and the one I picked: a CSS selector that matches only the headline (an element whose content is plain text), and as goal the sign-up page or event.
4. Do not start it: I start it in Canopus.

Error tracking

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in English.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Send the errors of this product to Canopus, which replaces Sentry.

1. Call set_up_error_tracking. It returns the DSN (public by design: it can only add errors).
2. If this repository already uses a Sentry SDK, keep it: read the DSN from a new CANOPUS_DSN environment variable instead of the Sentry one, and set tracesSampleRate and replaysSessionSampleRate to 0 (Canopus keeps errors and logs, not traces or replays). Change nothing else.
3. If it does not, install the official Sentry SDK of this stack (for Next.js, @sentry/nextjs with its instrumentation files), init it with CANOPUS_DSN, enableLogs true, the two sample rates at 0, and sendDefaultPii false.
4. Set release to the commit sha the deployment exposes, so a problem says which deploy brought it.
5. If the build minifies JavaScript, add the source maps upload after the build: download https://www.canopushq.io/canopus-sourcemaps.mjs into the repository and run it with the release, reading the key from CANOPUS_API_KEY (scope sourcemaps:write, created in Canopus, Settings, API). It deletes the maps from the output.
6. Add a temporary route or script that throws a test error, run it locally with CANOPUS_DSN set, then call list_error_issues and check the error arrived. Remove the test code.
7. Tell me which environment variables to set in production, and what to deploy.
Reference: https://www.canopushq.io/en/docs/errors

What stays yours

  • Connecting Stripe, adding the sending domain, creating a key or a webhook secret, the logo.
  • Every approval: a campaign, a post, a strategy, a survey switched on, a test started, an ad budget.
  • The CRM webhook prompt is on the webhook page once the secret exists: it carries your own CRM fields.