A powerful VS Code extension that provides a live visual diagram of your DBML (Database Markup Language) files and securely exposes your live schema to AI assistants via a built-in Model Context Protocol (MCP) server.
Features
Live DBML Visualization
Automatically parses your active .dbml file as you type.
Renders a beautiful Entity-Relationship Diagram (ERD) using Mermaid.js directly inside a VS Code Webview.
Bundled MCP Server
Spins up a local MCP server in the background using stdio transport.
Syncs your active editor's DBML content in real-time.
Exposes a dbml://current-schema resource so AI assistants (like Claude or Cursor) can perfectly understand your database schema without you having to copy-paste your code.
How to Run the Extension
Open this project in VS Code.
Press F5 to launch the Extension Development Host.
In the new VS Code window, open or create a .dbml file.
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and select Show DBML Viewer.
Edit your .dbml code and watch the diagram update instantly!
How to Connect to AI (MCP Setup)
Because this extension bundles an MCP server, you can give your AI agents live access to your database schema.
Claude Desktop
Add the following to your Claude configuration file (~/.claude_desktop_config.json on Linux/Mac):
Once connected, you can ask your AI: "Write a SQL query joining the tables from my dbml://current-schema" and it will magically know exactly what you've designed!
For details on how the extension is built, see the docs/ folder.