Skip to main content
Memory Crystal reads configuration from environment variables. Which variables you need depends on your setup — cloud users only need an API key, while self-hosted deployments require a few more.

Cloud setup

If you’re using the hosted Memory Crystal service at memorycrystal.ai, you only need one variable:
VariableDescriptionRequiredExample
MEMORY_CRYSTAL_API_KEYYour API key from the Memory Crystal dashboard. Also accepted as CRYSTAL_API_KEY.Yesmck_abc123...
Get your API key from the Memory Crystal dashboard.

Full variable reference

VariableDescriptionRequiredExample
MEMORY_CRYSTAL_API_KEYAPI key from the dashboard. Also accepted as CRYSTAL_API_KEY.Yes (cloud)mck_abc123...
MEMORY_CRYSTAL_API_URLYour Memory Crystal backend URL. Also accepted as MEMORY_CRYSTAL_BACKEND_URL or CRYSTAL_BASE_URL.Yes (self-hosted)https://your-project-123.convex.site
CONVEX_URLSame as MEMORY_CRYSTAL_API_URL. Used by the OpenClaw plugin.Yes (plugin)https://your-project-123.convex.site
CONVEX_DEPLOYMENTYour Convex deployment identifier. Only required for self-hosted deployments.Self-hosted onlyprod:your-project-123
Cloud users only need MEMORY_CRYSTAL_API_KEY. The plugin and MCP server default to the hosted backend, so no URL configuration is required.

Where to set variables

MCP server

Set variables in your shell environment or in the env block of your MCP config:
{
  "mcpServers": {
    "memory-crystal": {
      "command": "crystal-mcp",
      "env": {
        "MEMORY_CRYSTAL_API_KEY": "your-api-key-here",
        "MEMORY_CRYSTAL_API_URL": "https://your-deployment.convex.site"
      }
    }
  }
}

OpenClaw plugin

Set variables in your shell environment, or in mcp-server/.env in the Memory Crystal repo directory. The plugin reads from the process environment at startup.

Self-hosted deployments

For self-hosted setups, set CONVEX_URL and CONVEX_DEPLOYMENT in your shell and in mcp-server/.env:
CONVEX_URL=https://your-project-123.convex.site
CONVEX_DEPLOYMENT=prod:your-project-123
MEMORY_CRYSTAL_API_KEY=your-api-key-here
If you don’t set CONVEX_DEPLOYMENT and CONVEX_URL, Memory Crystal falls back to the hosted cloud backend. Your data will not stay on your own infrastructure.