---
title: "remote provision"
description: "Deploy a new Alchemy stack and configure the CLI for it."
---

> 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.

# remote provision

## Prerequisites

`provision` creates the Cloudflare infrastructure for the remote DB (and optional MCP).

You need a Cloudflare account that can create:

- Workers (router, API, MCP, and optionally docs)
- A D1 database
- A Vectorize index
- Workers AI
- A KV namespace (for MCP OAuth state)

## Usage

```sh
machine-memory remote provision
```

Deploys the [Alchemy stack](https://github.com/jfalava/machine-memory/tree/master/iac):

1. Creates the edge **router** (public URL) plus private **API** and **MCP** workers
2. Optionally builds and deploys the **docs** worker (`docs: true` in config, default for the upstream site)
3. Generates or reuses a Worker token for REST
4. Saves the router URL and credentials in the OS keychain

### Self-host without docs

```sh
cp iac/machine-memory.deploy.example.json ./machine-memory.deploy.json
# set domain, worker names, "docs": false
machine-memory remote provision --config ./machine-memory.deploy.json
```

Or:

```sh
machine-memory remote provision --no-docs --domain memory.example.com
```

Full field reference: [Deployment options](/infrastructure/deployment).

## Names and defaults

| Option                 | Environment variable           | Default                    |
| ---------------------- | ------------------------------ | -------------------------- |
| `--config`             | `MACHINE_MEMORY_DEPLOY_CONFIG` | auto-discover              |
| `--domain`             | `MACHINE_MEMORY_DOMAIN`        | (workers.dev router)       |
| `--no-docs` / `--docs` | `MACHINE_MEMORY_DEPLOY_DOCS`   | docs on                    |
| `--stack-name`         | `MACHINE_MEMORY_STACK_NAME`    | `machine-memory-remote-db` |
| `--database-name`      | `MACHINE_MEMORY_DB_NAME`       | `machine-memory-db`        |
| `--router-name`        | `MACHINE_MEMORY_ROUTER_NAME`   | `machine-memory-router`    |
| `--api-name`           | `MACHINE_MEMORY_API_NAME`      | `machine-memory-api`       |
| `--mcp-name`           | `MACHINE_MEMORY_MCP_NAME`      | `machine-memory-mcp`       |

Flags take precedence over the config file, then environment variables, then stored remote credentials, then defaults.

```sh
machine-memory list --remote
```

## MCP on the same stack

After the stack is up, follow [Enable MCP](/docs/mcp/enable). Overview: [MCP](/docs/mcp/overview).

Source: https://machine-memory.jfa.dev/human/remote/provision/index.mdx
