Connect your agent

PocketsHub runs an MCP server so coding agents such as Claude Code, Codex, Cursor and VS Code can create pockets, deploy instances and read deployment status for you.

1. Add the server and sign in

The server's address is https://api.pocketshub.com/mcp. Add it to your agent with just that URL. The agent opens your browser, you sign in to PocketsHub and choose what it may do. No API key to copy or store.

Claude Code

Run this once, then type /mcp in Claude Code, pick pocketshub and choose Authenticate. Add --scope user to make it available in every project.

claude mcp add --transport http pocketshub https://api.pocketshub.com/mcp

Codex

Add the server, then sign in. Codex opens your browser for the second step.

codex mcp add pocketshub --url https://api.pocketshub.com/mcp
codex mcp login pocketshub

Cursor and VS Code

These buttons open the editor and add PocketsHub with only the URL. Approve the sign-in in your browser when the editor asks.

Full access or read-only

When you approve a connection you choose how much the agent can do.

  • Full access can use every tool below: create and change pockets and instances, redeploy, and read admin passwords.
  • Read-only sees only the tools that list and read pockets, instances, files, versions, deployments and logs, plus wait_for_deployment. It can't change anything or read admin passwords.

Every connection appears under Connected apps in Settings, with when it was last used. Disconnect it there at any time.

For scripts and CI: API keys

Use a key when the tool can't open a browser. Create one under API keys in Settings, choosing Full access or Read-only. It starts with ph_live_ and is shown once, so copy it straight away. Keep it secret and revoke it from the same place if it leaks. Every request carries it as an Authorization: Bearer header; snippets use ph_live_… as a placeholder, and you should never commit a real key.

Claude Code

claude mcp add --transport http pocketshub https://api.pocketshub.com/mcp \
  --header "Authorization: Bearer ph_live_…"

Codex

Add this to ~/.codex/config.toml. Codex reads the token from the named environment variable, so the key stays out of the file.

[mcp_servers.pocketshub]
url = "https://api.pocketshub.com/mcp"
bearer_token_env_var = "POCKETSHUB_API_KEY"
export POCKETSHUB_API_KEY="ph_live_…"

Cursor

Add this to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project. Cursor fills in ${env:POCKETSHUB_API_KEY} from your environment.

{
  "mcpServers": {
    "pocketshub": {
      "url": "https://api.pocketshub.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:POCKETSHUB_API_KEY}"
      }
    }
  }
}

2. Ask for something

Once connected, describe what you want built. For example:

Use PocketsHub to build a todo-list backend: create a pocket with a `todos` collection (title, done) and a hook that logs new todos, deploy it as an instance, and tell me its URL once it's running.

The agent creates the pocket, starts the instance, waits for the deployment and reports back. Instances count against your plan's limit.

Available tools

Pockets

  • list_pockets: List your pockets.
  • get_pocket: Read one pocket, including its schema and hooks.
  • create_pocket: Create a pocket from a schema and hook files.
  • update_pocket: Change a pocket's schema, hooks or details.
  • delete_pocket: Delete a pocket. Requires confirm_name.

Instances

  • list_instances: List your instances.
  • get_instance: Read one instance, including its endpoint once it is running.
  • list_pocketbase_versions: List the PocketBase versions you can deploy.
  • create_instance: Start a PocketBase instance, optionally from a pocket.
  • get_instance_files: Read the schema and hooks the instance runs.
  • update_instance_files: Replace the schema and hooks wholesale and redeploy.
  • sync_instance_from_pocket: Pull the pocket's files into the instance, overwriting local edits.
  • redeploy_instance: Redeploy the stored files.
  • get_instance_admin_credentials: Read the instance's superuser email and password.

Deployments

  • list_deployments: List an instance's deployments.
  • get_deployment_logs: Read a deployment's provisioning logs.
  • wait_for_deployment: Wait up to 45 seconds for the newest deployment; call again if it times out.

Good to know

  • Deleting is dashboard-only. Agents, even with full access, can't delete instances or delete or restore backups; those stay in the dashboard. Tools that overwrite files (update_pocket, update_instance_files, sync_instance_from_pocket) are marked destructive, so clients that honour that ask for your approval first.
  • A failed first deployment can't be redeployed. The update, redeploy and sync tools then return INSTANCE_FAILED. The agent fixes the pocket, you delete the instance from the dashboard, and it creates a new one.
  • Deployment logs cover provisioning only. For runtime and hook errors, the agent calls the instance's own PocketBase logs API, GET <endpoint>/api/logs, signed in as the superuser with get_instance_admin_credentials. It records request errors and $app.logger() output, not console.log.
  • A busy instance rejects changes with INSTANCE_BUSY until its current deployment finishes. Errors come back as CODE: message.
  • Changing your password disconnects every connected app; sign in from each tool again. API keys keep working.
  • You can also show an instance's initial admin password from its page in the dashboard.