Generate Postgres test data with Claude, Cursor, or any MCP client
Weavori ships a built-in Model Context Protocol (MCP) server. Point your AI assistant at a PostgreSQL schema and it can introspect, estimate, generate, and sync data in natural language — with foreign keys intact by construction.
An MCP server is a standard bridge that exposes tools to AI assistants — Claude, Cursor, VS Code, and other Model Context Protocol clients. Weavori's MCP server gives those assistants five PostgreSQL tools: introspect, estimate, generate, doctor, and sync. The result: your AI assistant can read a schema, plan a dataset, and generate synthetic data in natural language — with foreign keys intact by construction, because the same engine backs both the CLI and the MCP server.
Why generate test data with an AI assistant
The zero-config workflow fits agents naturally. Instead of a developer reading a schema, choosing a generator strategy per column, and writing commands — an assistant can do all of it in a conversation:
- Introspect the schema before writing any code
- Estimate row counts and generation time before committing
- Generate synthetic data into a target database
- Doctor the environment when something's off
- Sync rows between databases
Because the assistant reads the schema first, it asks better questions and generates data that actually matches your tables — not generic rows from a tutorial.
The five tools
| Tool | What it does | Read-only |
|---|---|---|
introspect | Inspect a PostgreSQL schema and return its structure (tables, columns, FK relationships) | ✅ |
estimate | Estimate generation time and row counts before running | ✅ |
generate | Generate synthetic data into a target database | — |
doctor | Run comprehensive diagnostics on your Weavori environment | ✅ |
sync | Copy data between PostgreSQL databases | — |
Three of the five are read-only. generate and sync write only to the target database you specify.
How it works: a conversation
Connect Weavori's MCP server to Claude Desktop or Cursor, then ask:
"Introspect the database at postgres://user:pass@localhost:5432/mydb"
The assistant calls introspect and sees the real schema — tables, columns, foreign keys — not a summary you typed.
"Estimate how long it would take to generate data for my database"
It calls estimate and reports the expected row counts and generation time.
"Generate 500 rows of synthetic data for each table into the target database"
It calls generate, and Weavori resolves foreign keys in dependency order, parents before children, streaming with constant memory. The same pipeline as the CLI — same FK guarantees, same distributions, same benchmarks.
That's the whole loop: schema → plan → data, in natural language.
Getting started in one command
The MCP server runs two ways — zero-install via npx, or from a local binary:
The server reads WEAVORI_DATABASE_URL (optional fallback DSN) and WEAVORI_API_KEY (or a cached weavori login). Set both in your MCP client's config.
Claude Desktop — add the weavori server to claude_desktop_config.json, restart, and the five tools appear under the MCP icon. Cursor — add a command-type MCP server in Settings → Features, or drop a .cursor/mcp.json into your project. VS Code (Continue extension) and Qoder are configured the same way.
The MCP setup guide has copy-paste configs for all four clients, plus troubleshooting.
Honest boundaries
The MCP server is a bridge, not magic:
- It connects to a live database. For generating from raw
CREATE TABLEstatements without any database, use the CLI's DDL paste mode instead - It writes where you point it.
generateandsynctarget the database you specify — point them at a scratch database first - Large operations take time. Generation and sync can run for minutes on big schemas; raise the tool timeout in your MCP client if needed
The CLI and the MCP server are the same engine
One codebase, two interfaces. The CLI is for humans and pipelines — one command, flags, standardized exit codes, plain/json output. The MCP server exposes the same capabilities over JSON-RPC so AI assistants can drive them. Everything this site says about Postgres test data, seeding, and synthetic data applies to both.
Try it with your own schema
Point the MCP server at any PostgreSQL database — including a scratch database created for testing — and ask your assistant to introspect it before doing anything else. The tool responses are the fastest way to understand a schema you didn't write.
Related guides
- MCP setup guide — configs for Claude Desktop, Cursor, Continue, and Qoder
- MCP CLI reference — flags and options for
weavori mcp - Postgres test data — the five ways to get test data, compared
- How Weavori works — introspection, FK resolution, and distribution sampling
- API keys — headless authentication for the MCP server