Docs / MCP

Let AI coding agents deploy previews as a native tool

Configure PreviewShip as an MCP server so AI coding agents can deploy previews as a native tool call without copy-pasting commands.

Updated 2026-04-17

Answer First

PreviewShip MCP server is the cleanest option when you want an agent to deploy previews inside the coding conversation. Instead of asking the model to print commands for a human to run, the agent can call PreviewShip directly and return a preview URL as part of the workflow.

Key takeaways

  • Best for agent-first workflows where the model should finish the deploy step.
  • Removes command copy-paste between the chat UI and terminal.
  • Pairs well with Claude Code, Cursor, Windsurf, and any MCP-compatible client.

Recommended workflow

  1. Create an API key in PreviewShip.
  2. Add the PreviewShip MCP server definition to your client configuration.
  3. Expose `PREVIEWSHIP_API_KEY` in the MCP server environment.
  4. Ask your agent to build first, then deploy the static output folder or a single .html file and return the preview URL.

Comparison snapshot

QuestionMCPCLI
Who triggers deploy?The agent as a tool callA human or script
Best forEnd-to-end AI workflowsTerminal and CI flows
Output handlingStructured tool resultTerminal output or JSON
Interaction styleNative in chatCommand-driven

Why MCP is different from command suggestions

Many agents can suggest a deploy command, but that still leaves the human to switch context and run it. MCP changes that by turning deployment into an actual tool invocation.

For teams exploring agentic development, that difference matters. It shortens the loop from “build this UI” to “share a live preview.”

Where MCP fits in a delivery workflow

Use MCP for the handoff between code generation and stakeholder review. After the agent writes or edits the frontend, the same conversation can produce a live URL for review.

That makes PreviewShip particularly useful for design QA, prototype sharing, and rapid iteration cycles where speed is more important than full Git-based hosting automation.

For framework projects, instruct the agent to run the build step and deploy the generated dist, build, out, or export folder. If the agent created one self-contained HTML artifact, it can deploy that .html file directly.

Operational recommendation

Keep the CLI available even if MCP is your primary workflow. CLI remains useful for CI, fallback deploys, and environments where an MCP client is not available.

FAQ

Do I need MCP if the CLI already exists?
Not always. Use CLI when a human or script drives the deploy. Use MCP when you want the agent itself to complete the deploy step as a native tool action.
Which clients can use PreviewShip MCP?
Any MCP-compatible client can use it. Common examples include Claude Code, Cursor, and Windsurf.
Is MCP only useful for AI demos?
No. It becomes practical whenever your workflow includes an agent creating frontend changes and you want to review them immediately as a live site.
Should the agent deploy source code or build output?
Build output. Ask the agent to run the framework build first and deploy the generated static folder, or deploy a single .html artifact directly.