# ─── Server ─────────────────────────────────────────────────────────────── # Port the Hono backend listens on. PORT=8080 # Data API execution backend (also switchable per-session in the UI via the # Direct↔MCP toggle, which sends the x-amp-executor header): # direct — use the @datastax/astra-db-ts client (default) # mcp — route Data API traffic through the Astra Data API's own built-in # MCP server (POST /v1/mcp). Sends the Astra Token plus the # Feature-Flag-mcp header that enables that (opt-in) feature. AMP_EXECUTOR=direct # Optional: override the MCP endpoint used when AMP_EXECUTOR=mcp. Defaults to # /v1/mcp. Point this at a locally-run Stargate Data API # to exercise the MCP path without a hosted Astra DB, e.g.: # AMP_MCP_ENDPOINT=http://localhost:8181/v1/mcp # ─── Expose THIS app as an MCP server (POST /mcp, Streamable HTTP) ─────────── # Lets external MCP clients (Claude Desktop, other agents) use the Data API # toolset against the database configured below. All default OFF. # AMP_MCP_HTTP — mount POST /mcp at all (on|off) # AMP_MCP_EXPOSE_FULL_CATALOG — also expose the generic execute_data_api_command # tool (the full 21-command catalog), not just # the 5 read-only tools # AMP_MCP_ALLOW_WRITES — DANGEROUS: allow write/DDL commands through # that generic tool (deleteMany, dropTable, …) # against the real database. Never enable on a # shared/production deployment. # AMP_MCP_HTTP=off # AMP_MCP_EXPOSE_FULL_CATALOG=false # AMP_MCP_ALLOW_WRITES=false # CORS allow-origin for the SPA. In dev the Vite server runs on :5173 and # proxies /api to this server, so this only matters when the SPA is served # from a different origin than the API. SPA_ORIGIN=http://localhost:5173 # ─── Request guards (sensible defaults; tune only if needed) ──────────────── # Reject request bodies larger than this many bytes (default 1 MiB). # AMP_MAX_BODY_BYTES=1048576 # # Fixed-window rate limit applied to /api/v1/*. Bounds runaway agent loops and # accidental Astra/LLM quota burn. Set AMP_RATE_LIMIT=off to disable. # AMP_RATE_LIMIT=on # AMP_RATE_LIMIT_WINDOW_MS=60000 # AMP_RATE_LIMIT_MAX=240 # ─── Optional: pre-configure credentials from the environment ─────────────── # Any of these that you set are used as a fallback when the browser doesn't # send the corresponding header, and the setup screen shows them as # "auto-configured" (you can leave those fields blank). Leave them unset to # enter everything in the UI instead. The server never echoes these to the # browser — only presence booleans + the non-secret endpoint/keyspace/model # are exposed via GET /api/v1/config. # # ASTRA_DB_APPLICATION_TOKEN=AstraCS:... # ASTRA_DB_API_ENDPOINT=https://-.apps.astra.datastax.com # ASTRA_DB_KEYSPACE=default_keyspace # OPENAI_API_KEY=sk-... # OPENROUTER_API_KEY=sk-or-... # AMP_LLM_MODEL=gpt-4o-mini # When token + endpoint + an LLM key are all set above, the setup screen # offers a one-click "Connect with environment settings".