How It Works
Mistflow is built on a simple principle: your AI editor is smart enough to build apps — it just needs the right tools.
Architecture
Section titled “Architecture”┌──────────────────┐ MCP (stdio) ┌──────────────────┐│ AI Editor │ ◄──────────────────► │ Mistflow MCP ││ (Claude Code, │ JSON-RPC 2.0 │ Server (local) ││ Cursor, etc.) │ └────────┬─────────┘└──────────────────┘ │ HTTPS ▼ ┌──────────────────┐ │ Mistflow API │ │ (cloud) │ ├──────────────────┤ │ Build + Deploy │ │ Pipeline │ ├──────────────────┤ │ Cloudflare │ │ Pages (hosting) │ └──────────────────┘What runs locally
Section titled “What runs locally”The MCP server runs on your machine as a Node.js process, started by your editor. It:
- Receives tool calls from your AI editor via JSON-RPC 2.0 over stdio
- Validates inputs against schemas
- Forwards requests to the Mistflow API
- Returns structured results back to the editor
The MCP server never calls an LLM. It has no AI of its own. It’s a tool provider.
What runs in the cloud
Section titled “What runs in the cloud”The Mistflow API (FastAPI + PostgreSQL) handles:
- Project and org management
- Build execution and artifact storage
- Deployment to Cloudflare Pages
- Domain management and DNS verification
- Provenance tracking (which prompt built which feature)
The tool flow
Section titled “The tool flow”When you describe an app to your AI editor, here’s the typical sequence:
-
Planning — The AI calls
plan-appwith your description. Mistflow returns a structured plan: features to build, tech stack, file structure, and implementation order. -
Scaffolding — The AI calls
init-projectwith the plan. Mistflow creates the project, selects a template, and returns the initial file tree. -
Building — For each step in the plan, the AI calls
implement-step. This is where the AI writes actual code. Mistflow tracks each step’s output and validates it builds correctly. -
Deploying — The AI calls
deploy. Mistflow bundles the code, pushes it to Cloudflare Pages, and returns the live URL. -
Iterating — When you ask for changes, the cycle repeats from step 3. The AI calls
implement-stepfor the change, thendeployagain.
Key design decisions
Section titled “Key design decisions”Why MCP, not an API?
Section titled “Why MCP, not an API?”MCP is a standard protocol that AI editors already support. By exposing tools via MCP, Mistflow works with any compatible editor — today and in the future — without building separate integrations.
Why no built-in AI?
Section titled “Why no built-in AI?”Every AI editor already has an LLM. Adding another one would mean:
- Extra latency (double the AI calls)
- Extra cost (you’d pay for Mistflow’s tokens)
- Conflicts (two AIs disagreeing)
By staying tool-only, Mistflow is fast, cheap, and always aligned with your editor’s reasoning.
Why track provenance?
Section titled “Why track provenance?”When an AI builds your app, you lose the “why” behind decisions. Provenance tracking means every file, every feature, and every deploy links back to the prompt that created it. This is essential for teams and for debugging.
Security model
Section titled “Security model”- Auth: Clerk-based authentication. The MCP server authenticates via your API key (stored locally after first login).
- Isolation: Each org’s projects are fully isolated. No cross-org access.
- Code ownership: Your code is yours. Connect GitHub and push it to your own repo at any time.
- No secrets in transit: The MCP server communicates with the API over HTTPS. Build artifacts are stored encrypted at rest.