cPanel/generate_deploy_key
Tool · cPanel

generate_deploy_key

Generate an ed25519 SSH deploy key (public key) for a Git repository on one of the caller's hosting services. BOTH inputs are REQUIRED: service_id (the hosting service the key is for — obtain it via list_services) and repo_url (the repository URL). Returns the public key and provider-specific instructions for pasting it as a deploy key in GitHub, GitLab, or Bitbucket. Generation is idempotent — re-calling for the same (service_id, repo_url) pair returns the existing public key without creating a duplicate. The private key is never returned; it is installed directly on the server. Requires the cpanel:uapi scope. TIP — add the returned public key to the repository's DEPLOY KEYS (not your account-wide SSH keys); a given deploy key is unique to ONE repo across the whole provider, so "key already in use" means it is attached elsewhere. If a later clone fails with "Permission denied (publickey)", the deploy may reference an SSH IdentityFile that does not match this installed key — verify ~/.ssh/config IdentityFile lines point at the key this tool installed.

IdempotentOpen‑worldscope cpanel:uapi

Invoked over the MCP transport with a tools/call request naming this tool.

Authorization #

Requires a valid OAuth 2.1 bearer access_token whose grant includes the cpanel:uapi scope — Manage your hosting account via cPanel — read and change settings on the cPanel features JetHost has enabled (this can modify your account). The broker resolves the caller from the token and returns only records the account owns.

Parameters #

service_idintegerRequired
The hosting service ID to generate the deploy key for. Obtain it via list_services.
repo_urlstringRequired
The Git repository URL to associate the deploy key with (e.g. https://github.com/org/repo.git).

Response #

200 · application/json

deploy_keyobject
public_keystring
provider_instructionsstring
repo_idstring
ssh_clone_aliasstring
module_versionstring

Errors #

ResultWhen
{ "error": "invalid_repo_url" }See the tool description for when this result is returned.
{ "error": "cpanel_error" }See the tool description for when this result is returned.
{ "error": "not_found" }The requested item does not exist, or it belongs to another account. Cross-account IDs are indistinguishable from missing ones by design.