Repository avatar
Databases
v2.0.1
active

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

  1. 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.
  2. 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 / flagEffect
DIVZ_API_KEYRequired. API key from the console.
DIVZ_READ_ONLY=1 or --read-onlyHides 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_URLDefaults to https://api.divz.com.br.

Tools

ToolWhat it doesWrites
list_projects / describe_projectProjects with status, region, branches, size and health
create_projectNew PostgreSQL database, ready in seconds✔
get_database_schemaCompact schema: every table, column, PK and FK
list_tables / describe_tableTables, columns, constraints, indexes, RLS and policies
run_sqlOne statement, returns rows✔*
run_sql_transactionSeveral statements, all or nothing (migrations)✔
explain_sqlQuery plan; analyze for real timings (SELECT only)
list_slow_queriesTop queries from pg_stat_statements
get_advisorsSecurity and performance checks with fixes (RLS, SECURITY DEFINER, unindexed FKs, missing PKs, unused indexes, cache hit, dead rows, open IP access)
generate_typescript_typesTypeScript Row/Insert types and enums from the live schema
list_branches / create_branchInstant copy-on-write branches to test migrations or for previews✔
list_extensions / install_extensionpgvector, PostGIS, pg_trgm, pg_stat_statements…✔
get_connection_string / list_rolesConnection strings (least-privilege app role by default)
create_app_role / rotate_app_role / rotate_credentialsRole management and password rotation✔
get_ip_allow / set_ip_allowIP allowlist✔
search_docsSearches the DIVZ docs and guides
project_stats / project_activityLive 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.

  1. Crie a conta em console.divz.com.br e uma API key em Configurações → API keys (chave READ = só leitura garantida pelo servidor).
  2. 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.
  3. 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

NPM
@divz/mcp
Install Command
npm install @divz/mcp

Remote