Black Friday: Get 40% off Craft for Life!

用 Craft 創想

如何使用 MCP 將 Craft 連接到Claude Code

您可以為 Craft 文件啟用 MCP 伺服器,允許Claude Code直接與您的內容互動。本指南將引導您使用 MCP 設定 Craft 文件與Claude Code之間的連線。

Craft
Claude 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 Claude Code.

Click the “Imagine” tab in the sidebar

步驟1

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

步驟2

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

步驟3

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

步驟4

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

步驟5

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

在Claude Code中新增 MCP 連接器

在Claude Code中建立一個新的連接器,並使用 Craft 文件中的 MCP URL 連接這兩個服務。

步驟1

首先,請在 Claude Code 中確定您希望 MCP 伺服器的作用域:
  • 本地作用域(預設): 專案特定,僅您私有
  • 專案 :透過.mcp.json 檔案共享
  • 範圍:跨 、個人實用性
如果想要不同的作用域,請在下一個步驟中將作用域新增至命令的末端。
--scope project | --scope user

步驟2

在終端機中執行此命令以新增 Craft MCP 伺服器。將 craft 替換為一個方便識別 MCP 伺服器的簡短名稱。預設情況下,此命令使用本機作用域,從而確保連線僅限於您目前的專案。
在 Claude Code 中使用 /mcp 指令

步驟3

如果您已設定密碼,請在 Claude Code 中使用 /mcp 指令,選擇您剛剛建立的 MCP 伺服器,然後依照瀏覽器步驟登入。
在 Claude Code 中使用 MCP 伺服器

步驟4

您的 Craft MCP 伺服器現已設定完成!您可以在 Claude Code 中使用它來與您的 Craft 文件內容互動。

現在您可以向Claude Code詢問有關 Craft 文件的問題,甚至可以要求更新文件。您可以從下面的例子開始:

點擊範例即可將提示複製到剪貼簿

一些入門建議

瀏覽範例