MCP Server Setup
Configure Weavori's MCP server for AI-assisted synthetic data generation in Claude Desktop, Cursor, VS Code, and Qoder.
Weavori ships a built-in Model Context Protocol (MCP) server that exposes its data generation tools to AI assistants. This enables Claude, Cursor, and other MCP-compatible clients to introspect schemas, estimate generation costs, and produce synthetic data — all through natural language.
Available Tools
| Tool | Description | 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 | ❌ |
Prerequisites
- Option A: Weavori installed (
weavorion your PATH) - Option B: Node.js >= 18 (the MCP server runs via
npx @weavori/cli, no manual install needed) - A valid
WEAVORI_API_KEY(get one viaweavori subscribe) - A PostgreSQL database connection string
Environment Variables
The MCP server reads configuration from environment variables. Set these in your MCP client's configuration:
| Variable | Required | Description |
|---|---|---|
WEAVORI_DATABASE_URL | No (fallback) | Default PostgreSQL DSN when tools don't provide one |
WEAVORI_API_KEY | Yes | API key for authentication and quota management |
The database URL can also be passed directly to each tool as the url argument, which takes precedence over the environment variable.
Connection Methods
You can connect Weavori's MCP server using one of two methods:
Local binary — Requires pre-installing Weavori:
"command": "weavori",
"args": ["mcp"]
npx launcher — Zero-install, fetches the binary on demand (requires Node.js >= 18):
"command": "npx",
"args": ["-y", "@weavori/cli", "mcp"]
Both are equivalent. The examples below show the local binary method; substitute with npx if you prefer zero-install.
Claude Desktop
Edit claude_desktop_config.json (Claude → Settings → Developer → Edit Config):
{
"mcpServers": {
"weavori": {
"command": "weavori",
"args": ["mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
Or use the npx launcher (no manual install):
{
"mcpServers": {
"weavori": {
"command": "npx",
"args": ["-y", "@weavori/cli", "mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
Restart Claude Desktop. You should see the hammer icon with five Weavori tools available. Try asking:
"Introspect the database at postgres://user:pass@localhost:5432/mydb"
"Estimate how long it would take to generate data for my database"
"Generate 500 rows of synthetic data for each table into the target database"
Cursor
In Cursor, go to Settings → Features → MCP Servers → Add New MCP Server:
Type: command
Name: weavori
Command: weavori mcp
Environment variables:
WEAVORI_DATABASE_URL postgres://user:password@host:5432/dbname
WEAVORI_API_KEY your-api-key
Alternatively, add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"weavori": {
"command": "weavori",
"args": ["mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
Or use npx:
{
"mcpServers": {
"weavori": {
"command": "npx",
"args": ["-y", "@weavori/cli", "mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
After adding, the tools appear in Cursor's Composer (Cmd+K / Ctrl+K). Ask Cursor to generate data using natural language.
"Run doctor diagnostics on my database"
"Sync the public schema tables to my test database"
VS Code (Continue Extension)
Install the Continue extension, then edit ~/.continue/config.json:
{
"mcpServers": {
"weavori": {
"command": "weavori",
"args": ["mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
Or use the npx launcher:
{
"mcpServers": {
"weavori": {
"command": "npx",
"args": ["-y", "@weavori/cli", "mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
After saving, reload the Continue extension (Ctrl+Shift+P → "Continue: Reload"). The tools are available in Continue's chat panel.
Qoder
Qoder uses an mcp.json config file located at ~/.qoder/mcp.json. Add the Weavori MCP server entry:
Local binary:
{
"mcpServers": {
"weavori": {
"command": "/path/to/weavori",
"args": ["mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
On Windows, use the full path to the executable with escaped backslashes, e.g. "command": "C:\\\\Tools\\\\weavori.exe".
npx launcher (zero-install):
{
"mcpServers": {
"weavori": {
"command": "npx",
"args": ["-y", "@weavori/cli", "mcp"],
"env": {
"WEAVORI_DATABASE_URL": "postgres://user:password@host:5432/dbname",
"WEAVORI_API_KEY": "your-api-key"
}
}
}
}
No Windows path escaping needed — npx handles the binary discovery.
After saving, restart Qoder or reload the MCP connection. The Weavori tools become available whenever you ask Qoder to introspect, generate, or diagnose databases.
Troubleshooting
"weavori: command not found"
If using the local binary, ensure it's on your PATH. Run which weavori (or where weavori on Windows). Reinstall if needed.
If using the npx launcher, ensure Node.js >= 18 is installed and npx is on your PATH.
"Not connected" or tool calls fail silently
Check that WEAVORI_API_KEY is set correctly. Run weavori doctor from the terminal to verify your setup independently.
Connection timeouts
Ensure your PostgreSQL server accepts connections from the machine running the MCP server. Check network policies, firewall rules, and pg_hba.conf.
Long-running operations time out
Generation and sync operations can take minutes for large schemas. Configure your MCP client's timeout settings:
- Claude Desktop: Set
--max-timeout 600or increase thetimeoutfield inclaude_desktop_config.json - Cursor: Adjust Settings → Features → MCP → Tool timeout
- Continue: Set
"timeout": 600000in the MCP server config
Stderr logging
The MCP server writes log messages to stderr, which most clients capture and surface in their developer tools. Check client-specific logs for diagnostic information.