BlizDB MCP — VS Code Extension
Database explorer, SQL editor, data grid and MCP integration for BlizDB — a high-performance SQL database engine with multi-tenant support.

Architecture Overview
Database Engines
BlizDB supports two database engines — you choose which engine to use when creating a database:
| Engine |
Description |
BlizDB Native (native) |
Built-in high-performance engine with PostgreSQL-compatible syntax and extended features (SEND EMAIL, VACUUM, triggers, DO blocks, JSONB, and more). Default engine. |
PostgreSQL (postgres) |
Proxies queries to an external PostgreSQL v17 instance. BlizDB acts as a transparent proxy — the client connection stays the same; only the server-side storage changes. Requires a connection string to the PostgreSQL instance. |
Both engines are accessed through the same BlizDB connection. When using the PostgreSQL engine, BlizDB proxies all queries transparently — no separate connection is needed from the client or AI.
More external engines may be added in the future.
SQL Compatibility Highlights (native engine)
BlizDB's native engine speaks PostgreSQL-flavoured SQL, including:
- Joins: INNER / LEFT / RIGHT / FULL OUTER / CROSS — and LATERAL joins
(
, LATERAL (...), CROSS/LEFT JOIN LATERAL (...)) with correlated outer references
- Arrays: array types + functions, and containment/overlap operators
@>, <@, &&
- JSONB:
->, ->>, #>, #>>, containment @>/<@, merge ||, GIN-accelerated
- CTEs (incl.
WITH RECURSIVE), window functions, views, materialized views, triggers
information_schema (+ size_bytes/size_pretty/table_rows extension columns),
emulated read-only pg_catalog, and size functions (pg_size_pretty,
pg_total_relation_size, pg_database_size, …)
- PostgreSQL wire protocol (port 5432) — psql, ODBC, JDBC, npgsql, psycopg connect directly
The engine serves an always-current capability page at https://<your-server>/compatibility
(machine-readable summary at /llms.txt).
Multi-Tenant Hierarchy
BlizDB organises data in a strict hierarchy:
Portal → Domain → Database → Table
- Portal — top-level tenant (company or organisation)
- Domain — subdivision within a portal (department, environment, project)
- Database — belongs to a domain; uses either the native or PostgreSQL engine
- Table — standard table within a database
Features
Database Explorer
A full tree view in the VS Code sidebar showing your connection hierarchy:
- Connections — add, edit, remove and connect/disconnect servers
- Databases — browse all databases with active-database indicator (★), 24h insight tooltips, portal/domain info
- Tables — row counts, expandable columns (types, nullable, PK) and indices
- Portals & Domains — multi-tenant namespace management
- Users — view server users and roles
- Auto-refreshes on a configurable interval (default 30s)
SQL Editor & IntelliSense
- Open SQL files with
Ctrl+N or run ad-hoc queries
- IntelliSense with ~130 SQL keywords, live table names, column completions (qualified and unqualified)
- Context-aware: columns from referenced tables are boosted in suggestions
- Run query:
Ctrl+Enter (entire file) or Ctrl+Shift+Enter (selection only)
- Results shown as a styled table with row count, execution time, and copy to CSV/JSON
Interactive Data Grid
- Browse table data with pagination, sorting (click column headers) and filtering (SQL WHERE expressions)
- Inline editing — double-click any cell to edit, auto-commits via UPDATE
- Row deletion with confirmation dialog
- Configurable default row limit
Server Dashboard
Real-time server health panel showing:
- Hostname, OS, architecture, engine type
- CPU usage, memory (process + system), disk usage
- Database/table/row counts, connected clients, total queries
- PostgreSQL and HTTP port info, replication role
- Per-database 24h insights (reads, inserts, updates, deletes, avg query time)
- Auto-refreshes every 10 seconds
Compact status card in the sidebar with server metrics, CPU/disk progress bars, and connection info. Refreshes periodically with an in-flight guard so overlapping refreshes coalesce instead of stacking heavy metrics calls.
Server Log Viewer
Live-streaming log viewer with two tabs:
- SQL Queries — timestamp, query type, database (contextual path: Portal / Domain / DB), SQL preview, row count, duration, status
- Server Logs — real-time entries with level coloring (ERROR/WARN/INFO), user and database tags
- SSE live stream — connects to
GET /api/events?topics=logs,activity for instant updates (no polling delay)
- Automatic fallback to 3s HTTP polling if SSE is unavailable
- Pause/resume, clear, manual refresh
- Auto-reconnect with exponential backoff on SSE disconnection
MCP Integration (GitHub Copilot)
When you connect to a BlizDB server, the extension automatically registers the server's MCP endpoint in VS Code so GitHub Copilot can discover and use all database tools — no manual configuration needed.
Simply open Copilot Chat and ask:
- "List all tables in my database"
- "Show me the first 10 rows from the users table"
- "Create a new table called sensors with columns id, name, value"
- "What's the server status?"
30+ MCP tools are available for AI-assisted database operations:
Database creation is Native by default. MCP clients should only set PostgreSQL/MySQL backend fields when the user explicitly requests external storage. For BlizDB.com API connections, use connection name BlizDB.com, URL/host blizdb.com, port 443, and SSL enabled. For BlizDB.com PG-wire client connections, use pg.blizdb.com:5432.
| Tool |
Description |
blizdb_query |
Execute SQL queries |
blizdb_list_databases |
List all databases |
blizdb_create_database |
Create a Native database by default; explicit external backend only on request |
blizdb_drop_database |
Drop a database |
blizdb_list_tables |
List tables in a database |
blizdb_get_schema |
Get full schema |
blizdb_describe_table |
Describe table columns and indices |
blizdb_create_table |
Create a table via SQL |
blizdb_drop_table |
Drop a table |
blizdb_server_status |
Get server status/metrics |
blizdb_list_users |
List server users |
blizdb_create_user |
Create a user |
blizdb_delete_user |
Delete a user |
blizdb_backup_database |
Create a database backup |
blizdb_audit_log |
View audit log entries |
blizdb_server_logs |
Get recent server log entries |
blizdb_rename_database |
Rename a database |
blizdb_rename_table |
Rename a table |
blizdb_describe_database |
Get database details (engine, domain, storage, row count) |
blizdb_set_backend |
Set or change engine (native ↔ postgres) |
blizdb_migrate_backend |
Migrate data between engines |
blizdb_quota_summary |
Global quota overview |
blizdb_list_portals |
List all portals |
blizdb_create_portal |
Create a portal |
blizdb_delete_portal |
Delete a portal |
blizdb_describe_portal |
Get portal details |
blizdb_update_portal |
Update portal properties |
blizdb_list_domains |
List domains in a portal |
blizdb_create_domain |
Create a domain |
blizdb_delete_domain |
Delete a domain |
blizdb_describe_domain |
Get domain details |
blizdb_update_domain |
Update domain properties |
blizdb_assign_database |
Assign database to a domain (Portal → Domain → Database) |
blizdb_unassign_database |
Unassign database from domain |
Tools are discovered dynamically from the server at connection time, with a hardcoded fallback list. Destructive tools require user confirmation before execution.
If Copilot reports that a BlizDB tool is unavailable even though the extension is connected, run BlizDB: Diagnose MCP/Copilot from the Command Palette. The report checks the MCP settings entry, the server tool list, direct Language Model tool registration, and active connections without printing bearer tokens. You can also run BlizDB: Refresh MCP/Copilot Registration to rewrite the MCP registration and re-register the direct tools; existing Copilot chats may still need a new chat because tool lists can be snapshotted per session.
Real-Time SSE Event Stream
The extension maintains a persistent SSE connection to the server for instant push updates:
| Server Event |
Extension Reaction |
DatabaseChange / TableChange |
Refresh explorer tree |
StatusChange / Metrics |
Update status panel |
PortalChange / DomainChange |
Refresh explorer tree |
UserChange / SessionChange |
Refresh explorer tree |
ActivityChanged |
Refresh server log panel |
LogEntry |
Append to live server log stream |
Auto-reconnects with exponential backoff. Falls back gracefully if SSE is unavailable.
Query Execution Features
- Query cancellation — cancel long-running queries via server-side
queryId
- Explain query — run
EXPLAIN ANALYZE via Ctrl+Shift+E or the editor context menu
- Configurable timeout — per-query timeout with
blizdb.queryTimeout
- Parameterized queries — data grid uses server-side parameterized queries for safe inline editing
Multi-Tenant Support
- Portals & Domains — create and manage tenant namespaces
- Context switching — switch between Global, Portal, and Domain contexts
- View Access / Roles — right-click portals, domains, databases, or users to inspect role assignments
- Assign/unassign databases to domains
Getting Started
Prerequisites
Installation
Install from the VS Code Marketplace:
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "BlizDB MCP"
- Click Install
Or install from the command line:
code --install-extension Traberg-Larsen.blizdb-mcp
Add a Connection
- Open the BlizDB sidebar (click the BlizDB icon in the Activity Bar)
- Click Add Connection or run
BlizDB: Add Connection from the Command Palette
- Enter a name, host, port, and optionally enable SSL or provide an API key
- Connect by clicking the plug icon on the connection
Commands
All commands are available via the Command Palette (Ctrl+Shift+P) under the BlizDB category:
| Command |
Description |
BlizDB: Add Connection |
Add a new server connection |
BlizDB: Edit Connection |
Edit connection settings |
BlizDB: Remove Connection |
Remove a saved connection |
BlizDB: Connect |
Connect to a server |
BlizDB: Disconnect |
Disconnect from a server |
BlizDB: Refresh |
Refresh the explorer tree |
BlizDB: New SQL Query |
Open a new SQL editor |
BlizDB: Open SQL Editor |
Open the webview SQL editor |
BlizDB: Run Query |
Execute the active SQL file |
BlizDB: Run Selected Query |
Execute selected SQL text |
BlizDB: Browse Data |
Open the data grid for a table |
BlizDB: Describe Table |
Show table schema |
BlizDB: Create Database |
Create a new database |
BlizDB: Drop Database |
Delete a database |
BlizDB: Drop Table |
Delete a table |
BlizDB: Set Active Database |
Set the working database |
BlizDB: Copy Name |
Copy item name to clipboard |
BlizDB: Copy SELECT Statement |
Copy a full SELECT for a table |
BlizDB: Copy INSERT Template |
Copy an INSERT template |
BlizDB: Backup Database |
Create a database backup |
BlizDB: Open Dashboard |
Open the server dashboard |
BlizDB: View Audit Log |
View audit log |
BlizDB: View Server Log |
Open live server log |
BlizDB: Run Self-Test |
Run server self-diagnostics |
BlizDB: Manage API Keys |
List, create, and revoke API keys |
BlizDB: Switch Context |
Switch portal/domain context |
BlizDB: Create/Delete Portal |
Manage portals |
BlizDB: Create/Delete Domain |
Manage domains |
BlizDB: Explain Query |
Run EXPLAIN ANALYZE on active SQL |
BlizDB: View Access / Roles |
View role assignments for a resource |
Keyboard Shortcuts
| Shortcut |
Action |
Ctrl+Enter |
Run entire SQL file |
Ctrl+Shift+Enter |
Run selected SQL |
Ctrl+Shift+E |
Explain query (EXPLAIN ANALYZE) |
Settings
Configure via File > Preferences > Settings and search for "BlizDB":
| Setting |
Default |
Description |
blizdb.connections |
[] |
Saved server connections (name, host, port, SSL) |
blizdb.autoRefreshInterval |
30 |
Explorer auto-refresh interval in seconds (0 to disable) |
blizdb.defaultRowLimit |
100 |
Default row limit when browsing table data |
blizdb.queryTimeout |
30000 |
Query execution timeout in milliseconds |
blizdb.maxResultRows |
10000 |
Maximum rows to display in results panel |
Development
Setup
git clone https://github.com/antigravity/blizdb-vscode.git
cd blizdb-vscode
npm install
Build
npm run compile # Development build
npm run watch # Watch mode (rebuilds on save)
npm run package # Production build (minified)
Debug
- Open the project in VS Code
- Press
F5 to launch the Extension Development Host
- The extension activates automatically when you open the BlizDB sidebar
Lint & Test
npm run lint # ESLint
npm test # Vitest
Publishing New Versions
Pushes to main automatically publish a new patch version to the VS Code Marketplace via GitHub Actions.
Manual Publishing
If you need to publish manually:
# Patch release: 0.1.0 → 0.1.1
npx vsce publish patch
# Minor release: 0.1.0 → 0.2.0
npx vsce publish minor
# Major release: 0.1.0 → 1.0.0
npx vsce publish major
CI/CD Setup
The GitHub Actions workflow (.github/workflows/publish.yml) requires a VSCE_PAT secret:
- Go to your repo Settings → Secrets → Actions
- Add
VSCE_PAT with your Azure DevOps Personal Access Token (Scope: Marketplace > Manage)
Build Without Publishing
# Create a .vsix file for local testing
npx vsce package
# Install locally
code --install-extension blizdb-mcp-0.1.0.vsix
Updating Your PAT
If your Personal Access Token expires:
- Go to https://dev.azure.com → User Settings → Personal Access Tokens
- Create a new token (Organization: All accessible, Scope: Marketplace > Manage)
- Update the
VSCE_PAT secret in GitHub and/or run npx vsce login Traberg-Larsen locally
License
MIT