# Give VS Code agent mode a real backend: Postgres, auth and storage

> Add Scribase to VS Code with .vscode/mcp.json and let agent mode create the database, sign-in and storage for your app.

Source: https://scribase.com/agents/vs-code

One file in .vscode connects agent mode to Scribase. VS Code asks for the token once and stores it securely, so it never lands in the repository.

## Connect VS Code

_.vscode/mcp.json_

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "scribase-token",
      "description": "Scribase access token",
      "password": true
    }
  ],
  "servers": {
    "scribase": {
      "type": "http",
      "url": "https://api.scribase.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:scribase-token}"
      }
    }
  }
}
```

VS Code supports MCP browser sign-in, so you can drop the headers and inputs and approve on the Scribase consent page instead. With a header, VS Code prompts for the agent token (scb_agt_) once and keeps it out of the file.

## Project rules file: .github/copilot-instructions.md

```markdown
## Scribase backend
- The backend is Scribase (Postgres, Auth, Storage, Realtime). App code uses @supabase/supabase-js with the URL and anon key that `npx scribase init` writes.
- Never ask me for keys. To sign in, run `scribase login --json`, show me the link and code, and wait for my approval.
- Schema changes are SQL files in supabase/migrations/, rehearsed on a preview branch; every new table enables row-level security with owner policies.
- Merging into production, deleting environments and rotating keys need my explicit approval for that operation.
- Never print, log or commit keys. Full rules: https://docs.scribase.com/llms.txt
```

## FAQ

**Can the agent break production?**

Every write tool waits for an explicit confirm, and schema.apply only accepts a token that policy.test issued for the same schema, so an unproven row-level-security policy cannot be applied. Agent tokens are scoped and expiring, and every call is audited.

**What does it cost?**

Scribase is priced per project, flat, with no usage surprises. See the pricing page for the current price. Sign-up includes a $1 card check that is credited back.

**Can I leave?**

Yes. export.run produces a portable bundle (Postgres dump, auth users, storage objects) you can restore anywhere Postgres runs.