# A backend your coding agent can operate: Scribase for Cursor

> Scribase gives Cursor, Claude Code and other MCP clients a typed backend: preview branch, apply a migration, run a policy test, then merge with approval.

Source: https://scribase.com/for/cursor-backend

Coding agents are good at writing migrations and bad at knowing when a migration is dangerous. Scribase ships an MCP server that exposes the backend as typed tools: the agent works on a preview branch, runs the Aegis mutation test against its row-level security policies, and asks before merging. Production is never the agent’s scratchpad.

## What this audience is building

- An MCP server the editor can connect to without a local database
- Schema changes that land on a preview branch first
- Proof that a new RLS policy does not leak rows before it merges

## How Scribase meets each need

**Remote or local MCP** — Run scribase-mcp locally over stdio, or point the editor at the hosted HTTP endpoint with a personal access token. Both expose the same tools: projects, environments, branches, SQL, migrations, and policy tests.

**Preview, test, merge** — The default agent path is create preview branch, apply the change, run policy.test (the Aegis mutation harness), show the result, and merge only after confirmation. Destructive operations go through the approval gate.

**Typed results** — scribase gen types writes the Database type for your client from the live schema, so the agent’s next edit is type-checked against the table it just created.

_# .cursor/mcp.json_

```
{ "mcpServers": { "scribase": {
  "url": "https://api.scribase.com/mcp",
  "headers": { "Authorization": "Bearer ${env:SCRIBASE_ACCESS_TOKEN}" }
} } }
```

## FAQ

**Which editors work with the Scribase MCP server?**

Any MCP client: Cursor, Claude Code, Claude Desktop, Windsurf, VS Code, and others. Local clients can use stdio; clients that support remote servers can use the streamable HTTP endpoint with a bearer token.

**Can the agent drop a production table?**

Not without a person. Destructive operations require approval, and the recommended flow keeps the agent on a preview branch until the policy test passes and you confirm the merge.

## Related

- [MCP server](https://scribase.com/mcp)
- [AI agents use case](https://scribase.com/use-cases/ai-agents)
- [Preview databases per pull request](https://scribase.com/guides/preview-databases-per-pull-request)