Imagine With Craft

How to Connect Craft to OpenCode with MCP

Step-by-step guide to connect Craft documents to OpenCode via MCP. Read, search, and update your notes directly from OpenCode.

Craft
OpenCode

Adding an MCP Connector in OpenCode

Create a new connector in OpenCode and use the MCP URL to connect the two services.

Step 1

imagine.connectGuides.mcpClients.opencode_mcp.steps.step1.description.text1
  • Project config: opencode.json in your project root (recommended)
  • Global config: ~/.config/opencode/opencode.json for all projects
The project-level config is shown above. For global config, use the path listed above instead.
opencode.json

Step 2

Paste the following into your config file. If creating a new file, you can use this as the complete contents:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "craft": { "type": "remote", "url": "https://mcp.craft.do/my/mcp" } } }

Step 3

Run opencode mcp auth craft in your terminal to authenticate. A browser window will open for you to sign in with your Craft account.
opencode mcp auth craft

Step 4

A browser window will open showing the Craft authorization page. Select the space you want to connect and click "Approve" to grant access.
Your Craft MCP server is now configured! Start OpenCode and begin interacting with your Craft doc content.

You can now ask OpenCode 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 App Templates