Skip to content
Scalpels home

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

Documentation

Crate

Agents

Updated

Crate has two MCP servers. The read server is at /mcp and the write server is at /mcp/write. They let an agent see what your registry serves, add Crate to a project, queue builds, and set up credentials for CI and deployments. Neither can add or remove repositories or read or change source tokens. No tool ever returns a credential's password.

Reaching Crate from your agent

Crate allows delegated MCP access, so an agent connected to Scalpels can call it through Scalpels with the Call installed apps ability. The agent acts as you, with your role in Crate. See Agents in the Scalpels docs for how to connect an agent and what passes through Scalpels.

Adding packages

There is no MCP tool for adding or removing repositories. An agent does that through the Laravel Cloud CLI instead, following Let your agent add packages. Those steps keep the GitHub token out of the conversation.

Read tools

served_repositories

Lists the repositories Crate serves, oldest first.

Argument Notes
limit 1 to 100, default 25.
cursor The next_cursor from the previous page.

Each repository has its id, name, url, type, status, has_source_credential and last_built_at. The URL is reduced to scheme, host, port and path, so a token embedded in it is never returned. next_cursor is null on the last page.

build_history

Lists builds, newest first. Build output is never returned.

Argument Notes
limit 1 to 100, default 25.
cursor The next_cursor from the previous page.
build_ids Only these builds.
repository_names Only builds of these packages.
statuses Any of queued, running, succeeded, failed, target_deleted.

Each build has its id, repository (null for a full build), trigger, status, started_at and finished_at. The trigger says what started it: manual, schedule, repository-added, repository-removed, source-credential-replaced, source-credential-cleared or mcp.

composer_repository

Returns the entry that adds Crate to a project's composer.json, and the commands that add it.

Argument Notes
package Optional. A package name, such as acme/private-package.

The response has the repository entry, a composer_json fragment keyed crate, and commands, starting with composer config repositories.crate composer https://crate.example.com. Every package Crate serves comes from that one repository, so the entry is the same for each package. When you pass a package, the response adds its composer require command and says whether the latest build serves it.

The tool does not change any files. The agent applies the entry to the project itself. The response also says where Composer's credential comes from: Connect your machine for a person, or create_project_credential for CI.

Write tools

trigger_build

Queues a full build, or a build of one package when you pass repository_name.

Argument Notes
idempotency_key Required, up to 191 characters.
repository_name Optional. Must be a package Crate serves.

The response has the build_id, its status, whether it was a duplicate, and a status_handle naming the build_history call that checks on it.

The idempotency key belongs to the caller. Calling again with the same key and the same request returns the original build with duplicate: true instead of queueing another. Reusing a key with a different repository_name fails with idempotency_key_conflict.

Builds requested this way are recorded before they are queued. If the queue loses one, Crate's scheduler queues it again within a minute. If the repository is removed before the build runs, the build ends as target_deleted.

create_project_credential

Creates a single-use code for a Composer credential that belongs to a project, for its CI or deployments. Only a Scalpels Admin can call it.

Argument Notes
project Required, up to 100 characters. The project the credential is for, such as acme/storefront. It becomes the credential's name.

The response has the expires_at time, the redeem address, and store_examples showing how to redeem the code and store the result in one command. The code works once, within 10 minutes. Redeeming it with a POST issues the credential and returns it as a COMPOSER_AUTH value.

The agent should redeem the code only inside the command that stores the result, such as gh secret set, and never print or log what comes back. See Credentials for CI and deployments.

Strict arguments

Every tool rejects arguments it does not know, and rejects a cursor that was not issued by the same tool.