使用指南

用 MCP 連接你的 Agent。

有了 Mografy MCP server,支援 MCP 的 Agent 都能直接在對話裡檢查、預覽、修改和匯出你的影片。一行指令就能在你的電腦上執行。

它能做什麼

npx mografy mcp 會啟動一個透過 stdio 溝通的本機 MCP server。它做的事和 mografy 指令一樣的事,只是變成工具:列出專案、檢查 scene、算出畫格、產生檢查圖、讀寫 scene 檔案、開啟播放器和匯出。

能執行終端機指令的 Agent,例如 Claude Code 和 Codex,搭配 Mografy Skill 就已經很好用。MCP 多了兩件事:沒有終端機的聊天 app,例如 Claude Desktop,也能使用 Mografy;而且每個 Agent 都能直接拿到畫格和檢查圖,自己看圖判斷。

先安裝 Mografy。 MCP 伺服器是 Mografy 的一部分,不用另外安裝。下面的指令都在 mografy 資料夾裡執行。如果在那裡 npx mografy --help 還不能執行,請照著 安裝指南.

加到你的 Agent

在 mografy 資料夾裡打開 Claude Code 或 Codex,貼上這段就好。代理會幫自己加入伺服器,你有用 Claude Desktop 的話也一起加好,最後確認已經連上。macOS 和 Windows 都一樣。

設定 Mografy MCP
Set up the Mografy MCP server for me. Guide: https://www.mografy.app/docs/mcp 1. Make sure the current folder is my Mografy workspace: it has a mografy.workspace.json (npx mografy@latest init created it; if I am inside one of its projects, go up to that folder). If there is none, stop and tell me to install Mografy first: https://www.mografy.app/docs/getting-started 2. Add the server to yourself from this folder: - Claude Code: claude mcp add mografy -- npx -y mografy mcp - Codex: codex mcp add mografy --env MOGRAFY_WORKSPACE=<absolute path of this folder> -- npx -y mografy mcp On Windows, put cmd /c in front of npx. 3. Ask me if I also use Claude Desktop. If I do, add a "mografy" server to its claude_desktop_config.json and keep the servers already there: command npx (on Windows: command cmd, args starting with /c npx), args -y mografy mcp, and env MOGRAFY_WORKSPACE set to the absolute path of this folder. If Claude Desktop cannot find npx, use the full path of npx. Then tell me to restart Claude Desktop. 4. Check that mografy is connected and call list_projects: it lists the workspace's projects/ and examples/. If the tools only appear after a restart, tell me to restart you. Do not change Mografy itself. If a step fails, tell me the error.

或自己跑一行

在 mografy 資料夾裡執行一次。

終端機
claude mcp add mografy -- npx -y mografy mcp

輸入 /mcp ,確認 mografy 已連線。

其他客戶端

任何能啟動本機 stdio 伺服器的 MCP 客戶端都可以:指令填 npx,參數填 -y mografy mcp,再把環境變數 MOGRAFY_WORKSPACE 設成你的 mografy 資料夾。

試試看

問你的 Agent 一件需要用到 Mografy 的事:

提示詞
列出我的 Mografy 專案,然後檢查最新的那個,給我看第 2 秒的畫面。

Agent 會列出專案、執行檢查,並給你看那一格畫面。接下來就像用 Skill 一樣,告訴它要改什麼。

工具

每個工具都用絕對路徑,或 list_projects。標示 會改檔案 的工具會寫入專案,其他工具只讀取。

list_projects

列出最近的專案、專案庫和內建範例。

project_info

尺寸、長度、鏡頭、節拍、原始碼檔案、參數和設定,以及最近一次的建置錯誤。

check

編譯 scene 並在 Chromium 試算圖。加上 motion 時,還會逐格掃描跳動、硬起步和硬停止。

render_frame

算出影片某一刻的畫面並以圖片回傳,讓 Agent 自己看。

review

會改檔案

在 renders/ 產生視覺檢查圖,並以圖片回傳。

read_source

讀取 scene 的原始碼檔案。

write_source

會改檔案

scene 檔案要先編譯並試算圖成功才會寫入。失敗的修改會回傳錯誤,你的檔案維持原樣。

create_project

會改檔案

在專案庫建立一個帶起始 scene 的新專案。

open_player

在 Mografy 播放器顯示專案:切換已開啟的播放器,或啟動一個新的。

export

會改檔案

把影片匯出到 renders/,並回報進度。取消這次呼叫就會取消匯出。Agent 只在你要檔案時才使用。

read_guide

讀取 Mografy Skill 和它的參考文件,給沒有安裝 Skill 的 Agent 用。

怎麼運作

與播放器同步

專案已經在播放器開著時,工具會直接透過播放器執行,你和 Agent 看到的畫面一致。沒開的話,server 會在背景開啟專案,閒置 5 分鐘後自動關閉。

寫入前先驗證

write_source 會先編譯並試算新檔案,通過才寫入;沒通過的話,原本的檔案完全不動。

你要求時才匯出

匯出需要時間,也可能覆蓋 renders/ 裡的檔案,所以 Agent 只會在你要檔案時才匯出。預設和格式都和播放器相同。

匯出設定 →
遵守 Mografy 規則

server 會要求 Agent 寫 scene 前先讀 Mografy Skill,每次修改後都執行 check 和 review。

全程在本機

server 透過 stdio 和 Agent 溝通,只連線到本機 127.0.0.1 上的播放器,不會自己開放任何網路連接埠。

安全

只打開你信任的專案。 專案的 scene 程式碼在播放器裡執行,權限和編輯器相同,所以打開別人的專案,就像執行別人的腳本。有沒有用 MCP 都一樣。

多數客戶端會在 Agent 呼叫工具前先問你。唯讀工具可以放心允許,需要留意的是 write_source 和 export.