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 and manage fixed PreviewShip projects as native tool calls without copy-pasting commands.

Updated 2026-07-15Built for SEO and GEO citation workflows

Answer First

PreviewShip MCP server is the cleanest option when you want an agent to finish the preview workflow inside the coding conversation. Instead of asking the model to print commands for a human to run, the agent can call PreviewShip directly to deploy browser-ready output, return the fixed preview URL, list projects, set public or password access, inspect versions, rollback, redeploy latest, or delete a confirmed unused project.

Deploy build artifacts, not source-code zips.

If you upload a zip, build the project first and zip the static output folder such as dist, build, out, or public with index.html and assets. Do not zip raw React/Vue/Next source folders with package.json and node_modules. Single .html, .md/.markdown, and .pdf files are supported directly by console upload, CLI, MCP, and the VS Code/Cursor extension.

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.
Covers project lifecycle tools: list/get/delete projects, set public/password access, list versions, rollback, redeploy latest, and list deployments.
Public access clears an existing project password; password access is a Pro capability.
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/.md/.markdown/.pdf file and return the preview URL.

5

Ask the agent to use `list_projects`, `set_project_access`, `list_project_versions`, `rollback_project_version`, or `delete_project` only after it has the correct project ID and any required confirmation name.

Comparison snapshot

QuestionMCPCLI
Who triggers deploy?The agent as a tool callA human or script
Best forEnd-to-end AI workflowsTerminal and CI flows
Project managementNative MCP toolsCLI commands or dashboard
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 dist, build, out, or export. A single self-contained HTML, Markdown, or PDF document can be deployed directly.

Project tools agents can call

PreviewShip MCP includes deployment tools and project-management tools. That means an agent can reason about the whole preview lifecycle instead of only creating new links.

Destructive or state-changing actions still need clear intent. Deleting a project and rolling back a fixed URL require exact project-name confirmation so an agent does not change the wrong project.

`deploy_preview`, `check_deployment`, `show_usage`, and `list_deployments` cover deploy and quota visibility.
`list_projects` and `get_project` show fixed preview URLs, status, access mode, and redeploy state.
`set_project_access` supports `PUBLIC` and `PASSWORD`; `PUBLIC` clears the existing password.
`list_project_versions`, `rollback_project_version`, and `redeploy_project_latest` cover version recovery.
`delete_project` removes the fixed URL, hosted project, deployment association, and Showcase entry after confirmation.

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, .md/.markdown, or .pdf file directly.

Can an MCP agent switch a password project back to public?

Yes. Use `set_project_access` with `visibility: "PUBLIC"`. PreviewShip clears the existing password and makes the fixed preview URL public again.

Can an MCP agent delete unused projects when Free is full?

Yes, if the user explicitly intends it and provides the exact project name confirmation. `delete_project` permanently removes the fixed preview URL, hosted project, deployment association, and Showcase item.