---
title: "Deploy"
description: "Alchemy Worker deploy and docs site prerender gotchas."
---

> Documentation Index
> Fetch the complete documentation index at: https://machine-memory.jfa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy

## Alchemy: non-interactive Cloudflare auth

**Symptom:** `AuthError: No credentials configured… set CI=1 to use environment-variable credentials.`

**Fix:** Export `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID`, then:

```sh
cd iac
CI=1 bun run deploy
# or
CI=1 bunx alchemy deploy --yes
```

Trim trailing spaces on the account id (Wrangler rejects `"[id] "`).

## Alchemy: resource exists but is not owned by this stack

**Symptom:** `OwnedBySomeoneElse: Cannot adopt resource 'machine-memory-api'…`

**Cause:** Fresh local Alchemy state against an account that already has the Worker/D1/Vectorize from a previous machine or stage.

**Fix:**

```sh
CI=1 bunx alchemy deploy --yes --adopt
```

Only adopt when you intend this checkout to manage the existing production names.

## Docs build

The docs package declares `satteri` as a development dependency, so the site
build can run directly from `docs/`:

```sh
bun run build
```

`bun run deploy` typechecks and builds first; use a clean `CLOUDFLARE_ACCOUNT_ID`
without trailing spaces when deploying.

## MCP secrets after deploy

Deploying without `MACHINE_MEMORY_GITHUB_*` / `MACHINE_MEMORY_COOKIE_ENCRYPTION_KEY` succeeds; MCP stays off until those secrets exist and you redeploy. See [Enable MCP](/docs/mcp/enable) and [MCP 503](/troubleshooting/mcp#mcp-routes-return-503).

Source: https://machine-memory.jfa.dev/troubleshooting/deploy/index.mdx
