@backwrite/mcp 0.2.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -40
- package/dist/index.js +893 -160
- package/dist/index.js.map +1 -1
- package/package.json +16 -7
package/README.md
CHANGED
|
@@ -1,72 +1,56 @@
|
|
|
1
1
|
# `@backwrite/mcp`
|
|
2
2
|
|
|
3
|
-
Official **Model Context Protocol (MCP)** server for
|
|
4
|
-
|
|
5
|
-
Connect AI tools such as **Lovable**, **Cursor**, **Windsurf**, and **Claude Code** directly to your Backwrite database to create and inspect tables, run migrations, enforce RLS policies, generate TypeScript types, and introspect database schemas autonomously.
|
|
3
|
+
Official **Model Context Protocol (MCP)** server for [Backwrite](https://backwrite.dev) (`2026-07-28` spec) — **35 tools**, **3 live MCP Resources**, **multi-round Elicitation**, **Agent Workspaces**, **Valkey Lockfiles**, and **Agent Plugins 1.0.0** export for Claude Code, Cursor, Codex, Windsurf, and ChatGPT.
|
|
6
4
|
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
## Quick Start
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx @backwrite/mcp
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### 2. Configure in Cursor (`~/.cursor/mcp.json` or project `.cursor/mcp.json`)
|
|
9
|
+
Always pass credentials and identifiers via environment variables — never commit live project or branch IDs.
|
|
18
10
|
|
|
19
11
|
```json
|
|
20
12
|
{
|
|
21
13
|
"mcpServers": {
|
|
22
14
|
"backwrite": {
|
|
23
15
|
"command": "npx",
|
|
24
|
-
"args": ["-y", "@backwrite/mcp"],
|
|
16
|
+
"args": ["-y", "@backwrite/mcp@0.3.1"],
|
|
25
17
|
"env": {
|
|
26
18
|
"BACKWRITE_URL": "https://api.backwrite.dev",
|
|
27
|
-
"BACKWRITE_SERVICE_KEY": "
|
|
28
|
-
"BACKWRITE_PROJECT_ID": "
|
|
29
|
-
"BACKWRITE_BRANCH_ID": "
|
|
19
|
+
"BACKWRITE_SERVICE_KEY": "${BACKWRITE_SERVICE_KEY}",
|
|
20
|
+
"BACKWRITE_PROJECT_ID": "${BACKWRITE_PROJECT_ID}",
|
|
21
|
+
"BACKWRITE_BRANCH_ID": "${BACKWRITE_BRANCH_ID}"
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
25
|
}
|
|
34
26
|
```
|
|
35
27
|
|
|
36
|
-
|
|
28
|
+
---
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"BACKWRITE_URL": "https://api.backwrite.dev",
|
|
46
|
-
"BACKWRITE_SERVICE_KEY": "bwk_service_...",
|
|
47
|
-
"BACKWRITE_PROJECT_ID": "bw_proj_..."
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
30
|
+
## Live MCP Resources (`resources/list` & `resources/read`)
|
|
31
|
+
|
|
32
|
+
| Resource URI | Description |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `backwrite://schema/current` | Live relational schema JSON (tables, columns, FKs, indexes, enums, RLS policies) |
|
|
35
|
+
| `backwrite://architecture/topology` | Project branches, direct `:5432` & PgBouncer `:6543` endpoints, and engine status |
|
|
36
|
+
| `backwrite://advisors/findings` | Live 5-Engine Advisor security, RLS, and index diagnostics |
|
|
53
37
|
|
|
54
38
|
---
|
|
55
39
|
|
|
56
|
-
##
|
|
40
|
+
## Agentic & Platform Tools (35 Tools)
|
|
57
41
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
| `backwrite_get_database_schema` | 1-roundtrip complete relational schema introspection (tables, columns, types, nullability, defaults, primary keys, foreign keys, indexes, RLS policies). |
|
|
62
|
-
| `backwrite_list_tables` | List user tables with column counts and primary keys. |
|
|
63
|
-
| `backwrite_describe_table` | Detailed inspection of a specific table. |
|
|
64
|
-
| `backwrite_list_branches` | List project branches (production, preview, development). |
|
|
65
|
-
| `backwrite_get_connection_string` | Direct wire (`5432`) and pooler (`6543`) connection coordinates. |
|
|
66
|
-
| `backwrite_generate_types` | Generate TypeScript interfaces, Prisma schema, or Drizzle schema. |
|
|
42
|
+
- **Parallel Agent Sandboxes**: `backwrite_spawn_worktree`, `backwrite_sync_schema`, `backwrite_workspace_lock` (contested-file lockfiles), `backwrite_agent_emit_event` (NATS/Realtime streaming), `backwrite_elicit_context` (multi-round MCP Elicitation), `backwrite_export_agent_plugin` (Agent Plugins 1.0.0 generator)
|
|
43
|
+
- **PostgreSQL 18 & CoW Branching**: `backwrite_execute_sql`, `backwrite_get_database_schema`, `backwrite_list_tables`, `backwrite_describe_table`, `backwrite_list_branches`, `backwrite_create_branch`, `backwrite_delete_branch`, `backwrite_get_connection_string`, `backwrite_generate_types`
|
|
44
|
+
- **PITR, Advisors & Data Plane**: `backwrite_list_snapshots`, `backwrite_create_snapshot`, `backwrite_list_advisors`, `backwrite_apply_advisor`, `backwrite_cache_get`, `backwrite_cache_set`, `backwrite_queue_stats`, `backwrite_list_secrets`, `backwrite_set_secret`, `backwrite_org_usage_limits`, and more.
|
|
67
45
|
|
|
68
46
|
---
|
|
69
47
|
|
|
48
|
+
## Security & Permissions
|
|
49
|
+
|
|
50
|
+
- **Zero shell/subprocess execution** and **0 `npm audit` vulnerabilities**.
|
|
51
|
+
- **Scoped network access**: Makes HTTPS `fetch` requests strictly to your configured `BACKWRITE_URL` (default `https://api.backwrite.dev`) with HTTPS enforcement, path-traversal protection, and 30s timeouts.
|
|
52
|
+
- **Localhost-first HTTP mode**: Optional `--http` server binds to `127.0.0.1` by default, enforces a 1 MiB body limit, requires explicit `sessionId` for SSE `/messages`, and ignores untrusted `Host` headers.
|
|
53
|
+
|
|
70
54
|
## License
|
|
71
55
|
|
|
72
56
|
Apache-2.0 © Backwrite
|