
mcp
br.com.divz/mcp
Managed PostgreSQL from Brazil: create databases, run SQL and migrations, branches, advisors.
Documentation
DIVZ MCP server
Give your AI agent a real PostgreSQL database. DIVZ is a managed serverless PostgreSQL from Brazil: flat price in BRL, PIX and boleto, Portuguese support, instant branches, PITR, pgvector and PostGIS.
This Model Context Protocol server lets Claude, Cursor, Codex, VS Code, Windsurf and any MCP client create databases, read the schema, run SQL and migrations, branch, check health and get connection strings.
🇧🇷 Leia em português
Quick start
- Create a free account at console.divz.com.br and an API key in Settings → API keys. A READ key makes everything read-only on the DIVZ side.
- Add the server to your client:
Claude Code plugin (MCP + a skill that teaches safe migrations on branches)
/plugin marketplace add agenciaraca/divz-mcp
/plugin install divz@divz
Set DIVZ_API_KEY in your shell before starting Claude Code.
Claude Code (MCP only)
claude mcp add divz -e DIVZ_API_KEY=divz_your_key -- npx -y @divz/mcp
Codex (~/.codex/config.toml)
[mcp_servers.divz]
command = "npx"
args = ["-y", "@divz/mcp"]
env = { DIVZ_API_KEY = "divz_your_key" }
Claude Desktop, Cursor, Windsurf, VS Code (mcpServers / servers block)
{
"mcpServers": {
"divz": {
"command": "npx",
"args": ["-y", "@divz/mcp"],
"env": { "DIVZ_API_KEY": "divz_your_key" }
}
}
}
Then ask: "Create a Postgres database for my todo app, add the tables and give me the DATABASE_URL."
Using Codex or Cursor? See AGENTS.md for a snippet that tells the agent how to use DIVZ.
Options
| Variable / flag | Effect |
|---|---|
DIVZ_API_KEY | Required. API key from the console. |
DIVZ_READ_ONLY=1 or --read-only | Hides every tool that writes; run_sql accepts only SELECT/WITH/SHOW/EXPLAIN. Combine with a READ key for a server-enforced guarantee. |
DIVZ_PROJECT=<slug> or --project=<slug> | Locks the server to one project: the agent cannot see or touch the others. |
DIVZ_API_URL | Defaults to https://api.divz.com.br. |
Tools
| Tool | What it does | Writes |
|---|---|---|
list_projects / describe_project | Projects with status, region, branches, size and health | |
create_project | New PostgreSQL database, ready in seconds | ✔ |
get_database_schema | Compact schema: every table, column, PK and FK | |
list_tables / describe_table | Tables, columns, constraints, indexes, RLS and policies | |
run_sql | One statement, returns rows | ✔* |
run_sql_transaction | Several statements, all or nothing (migrations) | ✔ |
explain_sql | Query plan; analyze for real timings (SELECT only) | |
list_slow_queries | Top queries from pg_stat_statements | |
get_advisors | Security and performance checks with fixes (RLS, SECURITY DEFINER, unindexed FKs, missing PKs, unused indexes, cache hit, dead rows, open IP access) | |
generate_typescript_types | TypeScript Row/Insert types and enums from the live schema | |
list_branches / create_branch | Instant copy-on-write branches to test migrations or for previews | ✔ |
list_extensions / install_extension | pgvector, PostGIS, pg_trgm, pg_stat_statements… | ✔ |
get_connection_string / list_roles | Connection strings (least-privilege app role by default) | |
create_app_role / rotate_app_role / rotate_credentials | Role management and password rotation | ✔ |
get_ip_allow / set_ip_allow | IP allowlist | ✔ |
search_docs | Searches the DIVZ docs and guides | |
project_stats / project_activity | Live stats and audit log |
* With a READ key the server runs it in a READ ONLY transaction.
Safety by design. Irreversible operations (delete project, delete branch, point-in-time restore) are not exposed: they stay in the console. Every tool carries MCP annotations (readOnlyHint, destructiveHint) so clients can ask before risky calls. Connection strings are secrets: keep them in DATABASE_URL.
Use as a library
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"
import { DivzClient, registerDivzTools } from "@divz/mcp"
const server = new McpServer({ name: "divz", version: "2.0.0" })
registerDivzTools(server, new DivzClient({ apiKey: process.env.DIVZ_API_KEY! }), { readOnly: true })
Português
Servidor MCP do DIVZ, o PostgreSQL gerenciado brasileiro: preço fixo em real, PIX e boleto, suporte em português, branches instantâneos, PITR, pgvector e PostGIS.
- Crie a conta em console.divz.com.br e uma API key em Configurações → API keys (chave READ = só leitura garantida pelo servidor).
- Claude Code:
claude mcp add divz -e DIVZ_API_KEY=divz_sua_chave -- npx -y @divz/mcp. Para os outros clientes use os blocos acima. - Peça ao agente: "Crie um banco Postgres para o meu app, monte as tabelas e me passe a DATABASE_URL."
Documentação completa: divz.com.br/docs/mcp.
License
MIT © DIVZ
@divz/mcpnpm install @divz/mcp