> ## Documentation Index
> Fetch the complete documentation index at: https://cloud.laravel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Connect AI agents to Laravel Cloud using the Model Context Protocol.

## Introduction

Laravel Cloud provides a remote [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that allows AI agents to manage your applications and infrastructure.

Once connected, your agent operates with the same permissions as your Cloud user account, scoped to the organizations and access levels you authorize. Changes your agent makes affect real applications, and Cloud bills your organization for any resources it creates.

## Connecting your agent

Cloud uses OAuth to securely authenticate your AI agent. Add the MCP server to your client, then follow its steps to start the authorization flow.

> [tab] Claude Code
>
> From your project directory, run the following command in your terminal:
>
> ```bash theme={null}
> claude mcp add --transport http laravel-cloud https://cloud.laravel.com/mcp
> ```
>
> Then, run `/mcp` in a Claude Code session in the same directory and select **laravel-cloud** to complete the authorization flow.

> [tab] Claude web and desktop
>
> On Claude.ai or in the Claude desktop app, open **Customize > Connectors** and add a custom connector with the following details:
>
> * **Name:** `Laravel Cloud`
> * **URL:** `https://cloud.laravel.com/mcp`
>
> Follow the prompts to add the connector and authorize access. On Team and Enterprise plans, an organization owner or someone with permission to manage connectors must add the connector before members can connect. For more information, see [Claude's custom connector setup guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).

> [tab] Codex CLI
>
> Run the following command in your terminal:
>
> ```bash theme={null}
> codex mcp add laravel-cloud --url https://cloud.laravel.com/mcp
> ```
>
> Codex detects that the server uses OAuth and opens your browser to complete the authorization flow. If you need to authenticate separately, run `codex mcp login laravel-cloud`.

> [tab] Cursor
>
> Add the following configuration to `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "laravel-cloud": {
>       "url": "https://cloud.laravel.com/mcp"
>     }
>   }
> }
> ```
>
> Cursor displays a **Needs login** prompt next to the server. Click it to complete the authorization flow.

> [tab] Amp CLI
>
> Run the following command in your terminal:
>
> ```bash theme={null}
> amp mcp add laravel-cloud https://cloud.laravel.com/mcp
> ```
>
> The next time you start the Amp CLI, it opens your browser to complete the authorization flow. If you need to authenticate again, run `amp mcp oauth logout laravel-cloud` and restart the CLI.

> [tab] Antigravity
>
> Add the following configuration to `~/.gemini/config/mcp_config.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "laravel-cloud": {
>       "serverUrl": "https://cloud.laravel.com/mcp"
>     }
>   }
> }
> ```
>
> Then, open the customization settings in Antigravity, refresh the list of MCP servers, and click **Authenticate** next to **laravel-cloud** to complete the authorization flow.

> [tab] Other
>
> Any MCP client that supports remote servers using Streamable HTTP and OAuth can connect to Cloud. Follow your client's instructions for adding a remote MCP server, and use the following URL:
>
> ```text theme={null}
> https://cloud.laravel.com/mcp
> ```
>
> If your client doesn't support remote servers or OAuth, you may use [`mcp-remote`](https://github.com/geelen/mcp-remote) to bridge the connection. Follow your client's instructions for adding a local MCP server, using the following command:
>
> ```bash theme={null}
> npx -y mcp-remote https://cloud.laravel.com/mcp
> ```

## Authorizing access

Cloud uses your existing browser session to authorize the connection and lets you choose an access level for each organization.

| Access level | What your agent can do |
| - | - |
| **Read & write** | Perform any action your permissions allow |
| **Read** | View resources your permissions allow, without making changes |
| **No access** | Nothing in this organization |

![The Laravel Cloud authorization screen, where you choose an access level for each organization before authorizing an agent](https://mintcdn.com/cloud/ThgUVbvpn8UoERPL/images/mcp/consent-screen.png?fit=max\&auto=format\&n=ThgUVbvpn8UoERPL\&q=85\&s=6b44640e5fb110e35f6d90d7c49cef52)

After choosing your access levels, click **Authorize** to return to your agent.

The role your Cloud account has in the organization still applies on top of the access level you choose. For example, if your role doesn't allow you to edit environment variables, your agent won't be able to edit them either, even with **Read & write** access enabled. For more information, see [Roles and permissions](https://cloud.laravel.com/docs/rbac.md).

## Managing connections

The **Authorized applications** section of your [account's security settings](https://cloud.laravel.com/profile/security) lists each agent you've connected, the organizations it can access, and when it was last used. From this section you can:

* Change a connection's access level for each organization by clicking **Edit**
* Disconnect an agent by clicking **Edit**, then **Revoke access to all**, which immediately invalidates its tokens

![The Authorized applications section of the account security settings, listing connected agents with their organizations and last accessed times](https://mintcdn.com/cloud/ThgUVbvpn8UoERPL/images/mcp/authorized-applications.png?fit=max\&auto=format\&n=ThgUVbvpn8UoERPL\&q=85\&s=2c51179f9e693f7a40c9b73a5227578f)

Some agents register using a new client ID each time they connect, so authorizing the same agent again may add a second entry instead of updating the existing one. You can revoke any entries you no longer use.

## What your agent can do

The MCP server exposes tools covering most actions available in the Cloud dashboard. The server marks each tool as either read-only or able to make changes. MCP clients may use these annotations to decide which tool calls need your approval.

| Area | Capabilities |
| - | - |
| **Applications and environments** | Create, update, start, stop, and delete applications and environments, and configure [preview environments](https://cloud.laravel.com/docs/preview-environments.md) |
| **Deployments** | Trigger deployments and read deployment status and build logs |
| **Compute** | Manage [instances](https://cloud.laravel.com/docs/compute.md), instance sizes, and background processes |
| **Environment variables and secrets** | Set and delete environment variables, and manage and link [secrets](https://cloud.laravel.com/docs/secrets.md) |
| **Databases** | Create databases and schemas, take snapshots, and restore backups into a new cluster |
| **Caches, object storage, and WebSockets** | Create, update, attach, and detach [caches](https://cloud.laravel.com/docs/resources/caches/valkey.md), [buckets](https://cloud.laravel.com/docs/resources/object-storage.md), and [WebSocket](https://cloud.laravel.com/docs/resources/websockets.md) servers |
| **Domains and network** | Add and verify custom domains and purge the [edge cache](https://cloud.laravel.com/docs/network.md) |
| **Queues** | Pause queues, purge jobs, and retry or delete failed jobs |
| **Commands** | Run commands, such as `php artisan migrate`, on an environment and read their output |
| **Monitoring** | Read environment logs, metrics, exceptions, and usage |
| **Organizations** | Invite and remove members, and manage roles |

### Deleting resources

To prevent accidental data loss, tools that delete core infrastructure require manual confirmation in the Cloud dashboard. This includes applications, environments, databases, caches, buckets, domains, compute instances, secrets, and WebSocket servers. When you ask your agent to delete one of these resources, it returns a link that opens the resource's deletion dialog in the dashboard.

> [!WARNING]
>
> Stopping an environment or detaching a resource doesn't remove it from your account. Cloud continues to bill for resources that remain provisioned.

### Agent skills

The MCP server also provides a set of [agent skills](https://agentskills.io), which are Cloud-specific guides for common tasks such as preparing an application for its runtime, connecting a custom domain, debugging a running application, and reducing costs. Your agent retrieves these skills through the `get-skill` tool, and the server's instructions direct your agent to consult them before starting related tasks.

## Security

Connecting an agent to Cloud gives it access to your infrastructure. Follow these practices:

* **Grant only the access you need.** Choose **Read only** for organizations your agent only needs to inspect, and **No access** for organizations it doesn't need at all.
* **Watch for prompt injection.** Content your agent reads, such as logs, issues, or web pages, may contain instructions written to manipulate it. Be cautious when using the Cloud MCP server alongside other tools that read untrusted content.
* **Verify the server URL.** Only connect to `https://cloud.laravel.com/mcp`, and double-check the URL when installing the server from a third-party directory.
* **Check the client name.** Cloud is unable to verify the client name shown on the authorization screen. Only authorize requests you started yourself.

Cloud masks sensitive data, such as database passwords and environment variable values, unless your agent specifically requests it and your permissions allow you to view it.

[Secrets](https://cloud.laravel.com/docs/secrets.md) work differently. Neither the dashboard nor the MCP server can read a secret's value after you save it.
