Prerequisites
Before you start, make sure you have:
- The Metabind CLI installed and signed in. See Install and Sign In. The CLI ships as a macOS binary through the Homebrew tap, with no Windows or Linux build and no
npxform yet. - A project you can edit, saved as your active context with
metabind use. Runmetabind statusto confirm which project you’re pointed at. - Any text editor. This tutorial edits a Markdown file, so you don’t need to know BindJS to finish it.
What You’ll Build
You’ll edit your project’s MCP instructions (the text Metabind surfaces to MCP clients), then publish that edit. Nothing here touches a component, so there’s no compile step and no way to break a running tool. The focus is the loop itself: Pull → edit → preview → push → publish.pull and the preview write nothing you can’t discard. push writes a draft. publish is the only step that changes what your live MCP app serves.
Pull Before You Push
push reads a baseline that pull records in .metabind/state.json to tell your edits apart from server-side changes. You have to pull a project before you can push it. Run push in a directory you never pulled, and it stops before doing anything:
1
Pull the Project Into a Folder
Write the project to a new directory. You now have a folder of files:
pull is read-only: it fetches the files and records the baseline push needs later.metabind.jsonc for project settings, mcp-instructions.md, components/ for BindJS source, tools/ for tool definitions, content/, and a CLI-owned .metabind/ directory holding the baseline. Secret values are never written, only their names. For the full layout, see the flat-file sync guide.2
Change One File
Open Save the file. This is an ordinary edit, detected by content rather than timestamp, so a file you didn’t touch never registers as changed.
mcp-instructions.md in the folder you pulled and add a line:3
Preview What Would Change
Before writing anything back, preview the change. You should see your project settings marked as updated and everything else unchanged.
push --plan reports the changelist and exits without touching the server.--plan never writes, so you can rerun it as often as needed.4
Push the Change as a Draft
Apply the edit. If someone edited the same entity in Studio since you pulled,
push writes to the server, but only ever as a draft, so nothing your published MCP app serves changes yet.push refuses the whole batch rather than merging, so follow Resolving Conflicts to reconcile it. It also stops before sending anything if an edit looks like it holds a secret value, so keep secrets in project secret bindings and reference them by name instead.5
Publish the Release
Promote the draft to published. This is the step that changes what your live app serves: the same release action as publishing from Studio.If you only wanted to try the loop, stop before this step. A draft stays untouched until you publish it or replace it with a fresh pull.
Verify It Works
Run the preview again from the same folder:What You’ve Built
You’ve run the full flat-file loop once: you pulled a project to disk, edited it in your own editor, previewed the change, pushed it as a draft, and published it. Two rules keep the loop safe:pull establishes the baseline push depends on, and push only ever writes drafts, so publish is the single deliberate step that goes live.
Next Steps
Flat-File Sync
The full workflow: project layout, conflicts, renames, and repairing local state.
CI Publish Lane
Run this same loop from GitHub Actions, without storing a credential.
Workflow Map
Every CLI command family, grouped by the job it does.