Skip to content
Scalpels home

Sign up now for $10 in credit on a new Laravel Cloud account.

Documentation

Scalpels

Attach to an existing app

Updated

A provider is one specific environment of a provider product your team runs. Attaching points one existing Laravel Cloud environment or Laravel Forge site at that provider, creates a per-app credential there, writes connection variables to the consumer, and opens a client-install pull request.

Attaching is available to team Owners and Admins, and it is free.

Prepare the provider

Before attaching an application:

  1. Install or adopt the provider product.
  2. Claim ownership of that provider deployment in Scalpels.
  3. Enable its credential API if the connected-apps screen says it is off.
  4. Connect GitHub and grant the Scalpels App access to the consumer repository.
  5. Connect Laravel Cloud or Laravel Forge for the consumer application.

Claiming ownership, enabling the credential API and attaching are all free, including to an Experimental provider.

Choose an application

Open the Cloud or Forge tab on the dashboard and select Check again when the inventory is stale or missing. Choose Connect beside the environment or site you want to attach.

Scalpels re-checks that the target still exists in the connected hosting account immediately before writing. It also checks the provider's credential index rather than treating a Scalpels database row as proof that a credential can be minted.

What is written

The real provider URL, newly minted token, any fixed recipe switches, and BFC_CLIENT_IDENTITY — the id of the connection Scalpels recorded — are written into the selected Cloud environment. For Forge, the same keys are merged through the whole-file read-merge-write process described in Connect Laravel Forge.

The pull request changes only files required by the provider recipe:

  • composer.json receives the client packages;
  • .env.example receives the variable names, with the token left blank;
  • .gitignore receives any product-owned paths.

The branch is named scalpels/connect-{product}. The pull request is requested as a draft and always carries [DRAFT] in its title. Scalpels cannot regenerate composer.lock, so check out the branch, run the package-specific composer update command shown in the pull request, commit the lock file, then review and merge it. Scalpels never merges it for you.

Apps hosted somewhere else

An externally hosted Laravel application can report to a provider without connecting its host or GitHub account to Scalpels. The provider must be running, claimed, and support bearer credentials. Asymmetric credentials remain limited to Laravel Cloud.

Tracked connections through your agent

  1. Ask your agent to read readiness with host: external and choose the exact provider deployment.
  2. The agent calls connection_plan with operation: connect, that provider, and an external_name such as Storefront production. It then calls apply_connection with the plan handle and a durable idempotency key. Routine connections use your MCP client's approval. This registers a pending connection without minting a credential or changing your host or repository.
  3. Open the returned setup_url yourself. Sign in as a team Owner or Admin and select Generate credentials. The page shows the provider recipe's packages, configuration, and any additional setup steps. Copy the credential variables into your host's secret configuration. They appear only in that response and cannot be revealed again. Do not paste them into your agent conversation.
  4. Install the packages, deploy the application, and restart its long-running workers. Scalpels does not do this for an external host.
  5. Ask the agent to call refresh_connections for the provider, then connection_status with host: external and the returned target. Scalpels reads the provider's credential-use observations. Issuance alone does not prove reporting, and an old or unknown sample is not a fresh confirmation. Package installation remains unknown because Scalpels cannot inspect the host.

The agent can rediscover these connections through readiness. Results are paginated with external_next_cursor. To disconnect, it plans operation: disconnect for the exact target. You must approve the separate protected link before the agent can apply that plan. Disconnect revokes the recorded credential and removes the connection. Your host variables and packages remain.

If issuance is interrupted, Scalpels does not retry. The agent can plan a disconnect only when the provider's index identifies the exact credential. Otherwise the connection stays blocked for investigation.

Untracked manual credentials

The existing dashboard flow remains available:

  1. Generate a credential. Open the provider from your dashboard and choose the Other tab. It lists the packages to require and the variables to set. Select Generate credentials. This needs a team Owner or Admin, and the provider deployment must be claimed. Scalpels issues a token on the provider and shows the .env lines once, with the token filled in. Scalpels does not keep the token, so copy it before you leave the page.
  2. Install the client. In the app, run the composer require line shown on the tab, then commit composer.json and composer.lock.
  3. Set the variables. Paste the lines into wherever the app keeps its environment: its .env file on the server, your host's environment settings, or your secrets manager. Leave the provider URL exactly as shown. Some clients need it to end in a path such as /ingest and others add the path themselves.
  4. Deploy. The app starts reporting once the client and the variables are both live. Clear any cached configuration with php artisan config:clear if the variables changed after it was cached.

The credential is issued on the provider under a name that starts with manual-, so you can find it and revoke it there later. Scalpels records nothing about the app, so the app does not appear in the provider's connected-apps list in Scalpels. Check the provider itself to see that it is reporting.

A pull request from attaching also adds variable names to .env.example and paths to .gitignore. When you connect by hand, make those changes yourself if you want them. Each provider's own docs list them, along with any step its client needs beyond the variables:

Refusals and repairs

No credential or environment change is made when Scalpels refuses before the write. Common messages mean:

  • No record yet: select Check again, then use the refreshed row.
  • Environment or site is gone: the connected account did not confirm the target.
  • Cannot be connected from what we can see: the target is the provider itself, already reporting, or its state could not be determined.
  • Already reports elsewhere: disconnect it from the other provider before repointing it.
  • Already being connected: wait for that attempt to finish and check again.
  • Ownership required: claim the provider deployment first.
  • Credential API not enabled: enable it and retry.
  • GitHub required or repository unreadable: connect GitHub or grant the App access to that repository.
  • Environment file could not be read safely: correct the named Forge .env problem; Scalpels wrote nothing.

Credential already issued / repair required means the provider already has the deterministic credential name, either because Scalpels has an attribution row or because the provider's own index reports it. The plaintext credential cannot be read back, and Scalpels will not issue a second credential over the first.

Check the connected-apps list or Forge tab to see whether the provider has heard from the consumer. If it has not, remove the named credential on the provider and connect again. When a local attribution exists, it remains because it is the only durable record of which provider the consumer was pointed at.