Black Friday: ¡Obtén un 40% de descuento en Craft de por vida!

Imagine With Craft

How to Connect Craft to Visual Studio Code with MCP

You can enable an MCP server for your documents, allowing Visual Studio Code to interact directly with your content. This guide walks you through setting up the connection between Craft and Visual Studio Code using MCP.

Craft
Visual Studio Code

Enabling MCP for Documents

First, you have to enable MCP in order for Craft to setup an MCP server for your documents. Then, you use the MCP URL to connect to the server from Visual Studio Code.

Click the “Imagine” tab in the sidebar

Step 1

Open the “Imagine” tab
Click “Create Your First MCP Connection” button

Step 2

Click “Create Your First MCP Connection”
Configure MCP connection settings

Step 3

Configure your MCP connection with a name.
Click “Add Document” button

Step 4

Click “Add Document” to select which documents this MCP connection has access to.
MCP URL displayed at the top

Step 5

The MCP URL that will be used to interact with your document is now displayed at the top.

Adding an MCP Connector in Visual Studio Code

Create a new connector in Visual Studio Code and use the MCP URL from Craft to connect the two services.

Open Visual Studio Code’s MCP Settings

Step 1

Go to Visual Studio Code’s MCP Settings by typing >mcp in the command palette and selecting “MCP: Open User Configuration”

Step 2

Copy the following MCP configuration and paste it into the MCP configuration file in Visual Studio Code. Replace craft with a descriptive name for your MCP server. Replace <MCP_URL> with the MCP URL from Craft.
Save the MCP configuration file

Step 3

Save the MCP configuration file. It should look something like this example. Press the “Start” button to start the MCP server.

You can now ask Visual Studio Code about your documents, and even have them updated. Try something like this to get started:

Click an example to copy the prompt to your clipboard

Some Ideas to Get You Started

Browse Examples