Deploy from Claude Code

6 min read Updated 1 day ago

Deploy from Claude Code

Claude Code is Anthropic's terminal coding assistant, and it speaks the Model Context Protocol (MCP) natively. Once you connect Ploi Cloud as an MCP server, Claude Code can create applications, attach managed databases, deploy from Git, and stream logs back into the chat. You write a prompt, the assistant calls the Ploi Cloud API on your behalf, and the result lands in your terminal. This guide walks through the one-line install, the OAuth handshake, the first deploy, and the prompts you will use most often.

Connect in one command

The fastest way to wire Ploi Cloud into Claude Code is the built-in claude mcp add command. Run it from any project directory:

claude mcp add --transport http ploi-cloud https://ploi.cloud/mcp

That registers the Ploi Cloud server in your global Claude Code config. The next time you open a session, the Ploi Cloud tools load automatically and become callable from chat.

Authorize once

The first time Claude Code calls a Ploi Cloud tool, your default browser opens an OAuth consent screen. Sign in with your Ploi Cloud account, approve the requested scopes, and Claude Code stores the access token locally. You only do this once per machine. To revoke access later, open your Ploi Cloud account settings and remove the authorized client. The next tool call from that machine triggers a fresh consent flow.

Deploy your first app

Three example prompts, one for each of the most common project types Ploi Cloud supports.

You: Deploy my Laravel app from github.com/myorg/checkout-service.

Claude Code: Creating an application called checkout-service. I detected PHP 8.3 and the extensions from your composer.json. Adding a MySQL service and a Redis cache based on your dependencies. Build command: composer install --no-dev --optimize-autoloader && npm install && npm run build. Deploying now. Live at https://checkout-service.ams.preview.ploi.it.

You: Deploy this Next.js app from the main branch of github.com/myorg/dashboard.

Claude Code: Creating dashboard. Detected Next.js 15 from package.json. Build command: npm install && npm run build. Adding Postgres because I see pg in your dependencies. Deploying. Live at https://dashboard.ams.preview.ploi.it.

You: Deploy this WordPress site from github.com/myorg/agency-blog.

Claude Code: Creating agency-blog as a WordPress application. Adding a MySQL service and a persistent volume for wp-content/uploads. Configuring the WordPress build template. Deploying. Live at https://agency-blog.ams.preview.ploi.it.

Add databases and caches

You do not have to leave the chat to provision services. Ask in plain English:

"Add a Postgres database to my checkout-service app."

"Attach Redis for sessions to dashboard."

"What services does agency-blog have right now?"

Claude Code calls v1_applications_services_store (or v1_applications_services_index for read-only listings), the credentials are auto-injected into your application's environment, and the platform handles the connection details for you. No .env file editing required.

Check logs and debug failures

When a deploy goes sideways, ask Claude Code what happened.

"Why did the last deploy of checkout-service fail?"

"Show me the last 100 lines of logs for dashboard."

"Restart the agency-blog app."

Claude Code pulls the deployment logs, identifies the error, and either reports the cause or, if you have the deploy skill installed, applies a fix and retries automatically.

Auto-fix with the pc-deploy skill

The pc-deploy skill for Claude Code takes the prompts above and chains them into one command. After you run /pc-deploy, the skill detects your project type, deploys it, monitors progress, and applies a fix automatically when something goes wrong.

The five auto-fix categories the skill currently handles:

  • Out of memory failures bumped from 1Gi to 2Gi to 4Gi
  • Missing PHP extensions installed via the PHP config endpoint
  • Build command adjustments when the default build script is wrong
  • Health check path changes when the default does not return 200
  • Missing environment variables added when the application errors with an undefined value

The skill retries up to five times, escalating fixes between attempts.

Common prompts

Prompt What Claude Code does
Deploy my app from github.com/org/repo Creates the application, detects framework, deploys
What services does my-app have? Calls v1_applications_services_index
Add Postgres to my-app Calls v1_applications_services_store with the Postgres preset
Set the secret STRIPE_KEY to sk_live_... Calls applications_secrets_store
Show me the logs for my-app Calls applications_logs
Roll back the last deploy of my-app Calls applications_rollback
Add the domain example.com to my-app Calls applications_domains_store
What is the SSL status for example.com? Calls applications_domains_ssl-status
Bump my-app memory to 2Gi Calls applications_resources_update
Suspend my-staging-app Calls applications_suspend

Troubleshooting

Claude Code does not see Ploi Cloud tools

Run claude mcp list to confirm the ploi-cloud server is registered. If it is missing, re-run the claude mcp add command from the connect section. If it is present but the tools are not loading, restart your Claude Code session and check the connection error with claude mcp logs ploi-cloud.

OAuth window closes before I can approve

This usually means the consent screen URL was opened in a browser that is not signed into Ploi Cloud. Open the URL Claude Code printed in your terminal manually, sign in to your Ploi Cloud account first, then re-trigger the tool call from chat.

Token expired or invalid

If a tool call returns "401 unauthenticated", run any tool again and Claude Code will trigger a fresh OAuth flow automatically. You can also clear the cached token by removing the entry under your local Claude config and reconnecting.

How do I switch between Ploi Cloud teams from chat

Ask Claude Code: "Switch to my staging team" and it will call user_switch-team. After that, all subsequent calls run against the new team's applications and services.

Next steps