Skip to content

Claude Code

Claude Code can work on your VAIF Studio project through the MCP server: read and write rows, create tables, manage storage, and deploy and invoke functions.

Install the CLI, sign in, and run the setup in your app’s folder:

Terminal window
npm install -g @vaifstudio/cli
Terminal window
vaif login
vaif claude-setup

vaif claude-setup writes two files in the current folder:

  • .mcp.json starts npx @vaifstudio/mcp for your project. It holds no credentials: the API key is read from VAIF_API_KEY in the environment Claude Code starts in, and the MCP server reads your vaif login sign-in from ~/.vaif/auth.json on every call.
  • CLAUDE.md gives Claude Code your tables and columns, with SDK and REST examples that use your table names and read the key from process.env.VAIF_API_KEY.
Option Meaning Default
-p, --project-id <id> The project From vaif.config.json, VAIF_PROJECT_ID or your sign-in
--skip-mcp Don’t write .mcp.json
--skip-claude-md Don’t write CLAUDE.md
-o, --output-dir <dir> Where to write the files .

An API key on the command line is refused, because other programs and your shell history could read it. Set VAIF_API_KEY in your shell instead. Run the setup again after schema changes, so CLAUDE.md lists the current tables. vaif init --claude writes a CLAUDE.md while it scaffolds a new app.

Register the server from a terminal, with VAIF_API_KEY and VAIF_PROJECT_ID set in your environment:

Terminal window
claude mcp add vaif-studio -- npx @vaifstudio/mcp
Variable Needed for Where it comes from
VAIF_PROJECT_ID Everything Your project ID, from the console or vaif.config.json
VAIF_API_KEY The row tools (query_rows, insert_row and the rest) and signed file links A project API key, from the project’s Overview or Project settings > API keys. get_signed_url needs a key with the storage scope
VAIF_AUTH_TOKEN Schema, SQL, storage, functions and key tools Optional. Without it, the server uses the sign-in that vaif login saved in ~/.vaif/auth.json, read again on every call
VAIF_API_URL A local or self-hosted API only Defaults to https://api.vaif.studio

Keep API keys out of files you commit.

The server has 27 tools, each with a title and safety labels, so Claude Code can tell a read from a change. See MCP server for what each one can change and how execute_sql stays read-only. Requests like these work:

  • “Create a posts table with title, body and user_id columns”
  • “Create a send_notification function and deploy it”
  • “Enable realtime on the posts table”
  • “Create a private avatars bucket”

Review what it changes, as you would a teammate’s change.