Migrate email templates using Knock's MCP server
Learn how to quickly migrate your email templates to Knock using our MCP server.
Storing your email templates in Knock comes with many advantages, but planning and executing a manual migration can require a significant amount of time and effort.
In this guide, we'll walk you through how to leverage Knock's MCP server with the LLM of your choice as a low-effort solution to quickly migrate your email templates to Knock.
Prerequisites#
Before getting started, you'll need access to the following:
- A Knock account.
- A configured email provider in your Knock account. Navigate to Integrations > Channels in your dashboard to set this up if you haven't already done so.
- A service token for your Knock account.
- An MCP-compatible client (such as Cursor or Claude Desktop). We recommend Cursor for working with a large collection of HTML files.
- Your existing email template files. Your templates will be upserted to Knock as HTML, so if you're using a format like MJML or React Email, you'll want to convert them to HTML before you begin.
For more information on setting up the Knock MCP server, see the Get started section of the MCP documentation.
Required MCP tools#
When working with MCP servers, it's recommended that you expose only the tools you need for your use case to your LLM. The steps in this guide will require access to the following tools:
documentation.*
channels.*
commits.*
emailLayouts.*
partials.*
workflows.*
Learn more about configuring these tools in your MCP-compatible client here. If you're using Cursor, you can simply copy and paste the configuration below into your MCP settings under the mcpServers
key.
Background#
While not required reading, you may want to familiarize yourself with the following concepts before beginning your migration so that you can understand more about the context for the prompts you'll be providing to your LLM:
- Workflows.
- Channel steps.
- Email layouts.
- Partials.
- Message template editor.
- Referencing variables and your Knock data in your templates.
- Knock liquid helpers.
Migration steps#
Now that you have everything you need for your migration, you're ready to get started!
Each step below contains a prompt that you can provide to your LLM. These prompts are designed to be run one at a time in order to provide the LLM with discrete tasks, thus improving the accuracy of the results.