PostgreSQL Schema Visualizer & Designer with AI-Powered Assistance
Secure • Simple • Smart
View Demo »
Report Bug
·
Request Feature
·
Discussions
Tiger SQL is a powerful, modern PostgreSQL schema visualizer and designer that combines intuitive visual design with AI-powered assistance enhanced by the Model Context Protocol (MCP). Built with Next.js 15 and React 19, it offers a seamless experience for designing, visualizing, and managing database schemas without requiring any installations or sensitive credentials.
Tiger SQL now features a scalable, multi-server MCP architecture that provides the AI assistant with up-to-date PostgreSQL knowledge and best practices:
- 🧠 PostgreSQL Expertise - Access to official PostgreSQL documentation via semantic search
- 📚 Best Practices - Curated PostgreSQL patterns and recommendations
- 🔄 Always Up-to-Date - Live knowledge from MCP servers (no outdated training data)
- 🎯 Intelligent Routing - Automatically decides when to use MCP based on request complexity
- 🔧 Extensible - Add your own MCP servers via configuration
- ⚡ Production-Ready - Built-in connection management, retry logic, and health checks
🐘 Built-in: pg-aiguide by Timescale
Tiger SQL comes with pg-aiguide pre-integrated - an AI-optimized PostgreSQL knowledge base created by Timescale. This MCP server provides:
| Tool | Description |
|---|---|
pg_view_skill |
Get curated PostgreSQL best practices on specific topics |
pg_list_skills |
Browse all available PostgreSQL knowledge topics |
pg_semantic_search_postgres_docs |
Semantic search across official PostgreSQL documentation |
No setup required! pg-aiguide works out of the box. The AI assistant automatically uses it when you ask about PostgreSQL best practices, optimization, or schema design patterns.
User Controls: Users can control MCP behavior with special commands:
[use-mcp]- Force MCP usage for this request[skip-mcp]- Skip MCP, use direct execution[mcp-verbose]- Show detailed MCP queries[use-server:server-id]- Use specific MCP server only[exclude-server:server-id]- Exclude specific server
Learn more about MCP: Vercel AI SDK MCP Documentation
- 🖱️ Drag & Drop Interface - Create and connect tables effortlessly
- 🔄 Undo/Redo Support - Full history management with keyboard shortcuts (Cmd/Ctrl+Z)
- 🎯 Smart Auto-Layout - Automatic table arrangement using Dagre algorithm
- 🌈 Random Table Colors - Beautiful, randomized color schemes for tables
- 📸 Export to Image - Save your schema as PNG
- 🔍 Zoom & Pan - Smooth navigation with minimap support
- 💬 Interactive Chat - AI assistant to help with schema design
- 🧠 Smart Suggestions - Get recommendations powered by PostgreSQL best practices via MCP
- 📝 Context-Aware - Understands your current schema state and uses up-to-date PostgreSQL knowledge
- 🚀 Powered by Multiple LLMs - Support for OpenAI and Google AI
- 🔌 MCP Integration - Access to real-time PostgreSQL documentation and expertise
- 📚 Best Practices - Automatic guidance from curated PostgreSQL patterns
Create relationships between tables by dragging from one column to another. Choose between two validation modes:
- Connect any column to any column without type restrictions
- Perfect for quick prototyping and sketching
- Ideal for custom types or extensions
- Maximum flexibility in schema design
- Only allows connections between type-compatible columns
- Validates PostgreSQL data type compatibility
- Prevents invalid relationships
- Production-ready schema design
| Category | Compatible Types |
|---|---|
| UUID | uuid |
| Integer | integer, int, int2, int4, int8, smallint, bigint, serial, smallserial, bigserial |
| Numeric | numeric, decimal |
| Float | real, float4, double precision, float8 |
| String | text, varchar, char, character, character varying |
| Boolean | boolean, bool |
| Date | date |
| Time | time, timetz |
| Timestamp | timestamp, timestamptz |
| JSON | json, jsonb |
| Binary | bytea |
- 📦 Import SQL - Load existing schemas from SQL files
- 💿 Export SQL - Generate SQL DDL for your schema
- 🔄 LocalStorage Persistence - Your work is automatically saved
- 🚪 No Login Required - Start designing immediately
- 🔒 Client-Side Only - All processing happens in your browser
- 👀 No Sensitive Data - Only uses public API keys
- 🔐 No Database Passwords - Secure by design
- 🚫 No Server Storage - Your data stays on your device
- ⚡ Lightning Fast - Built with modern React and Next.js
- 🎨 Beautiful UI - Powered by Tailwind CSS and shadcn/ui
- 📱 Responsive Design - Works on all screen sizes
- ⌨️ Keyboard Shortcuts - Power-user friendly
- 🌙 Dark Mode Support - Easy on the eyes
Simply visit Tiger SQL and start designing your schema immediately!
- Go to Supabase Dashboard
- Select your Project
- Navigate to
Settings→API - Copy your
URLandanon/publickey - Paste them into Tiger SQL
- Click "Fetch Schema"
- Start visualizing! 🎉
- Click "Import SQL" button
- Paste your SQL DDL or drag & drop a
.sqlfile - Watch your schema come to life!
Tiger SQL is built with modern, cutting-edge technologies:
- Next.js 15 - React framework for production
- React 19 - Latest React with concurrent features
- TypeScript - Type safety and better DX
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Beautiful, accessible components
- XYFlow/React Flow - Powerful flow diagram library
- Zustand - Lightweight state management
- AI SDK - AI integration by Vercel
- Zod - TypeScript-first schema validation
- Bun runtime (v1.0+)
-
Clone the repository
git clone https://github.com/jacksonkasi1/tiger-sql.git cd tiger-sql -
Install dependencies
bun install
-
Set up environment variables (Optional - for AI features)
cp .env.example .env.local
Add your API keys:
OPENAI_API_KEY=your_openai_key_here GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key_here
-
Configure MCP Servers (Optional - for custom MCP servers)
cp .mcp-config.example.json .mcp-config.json
The built-in pg-aiguide MCP server works out of the box. Add custom servers in
.mcp-config.json:{ "version": "1.0.0", "servers": [ { "id": "my-custom-mcp", "name": "My Custom MCP Server", "transport": { "type": "http", "url": "https://mcp.example.com" }, "enabled": true, "priority": 50, "tags": ["custom"], "toolNamespace": "custom_" } ] } -
Run the development server
bun dev
-
Open your browser
Navigate to http://localhost:3000
bun dev- Start development serverbun run build- Build for productionbun start- Start production serverbun run lint- Run ESLintbun run typecheck- Run TypeScript type checkingbun run analyze- Analyze bundle sizebun run test:memory- Run memory leak tests
Tiger SQL features a scalable, configuration-driven MCP architecture designed for production use:
- Multi-Server Support - Connect to multiple MCP servers simultaneously
- Configuration-Driven - Add/remove servers via JSON config files
- Intelligent Routing - Automatic tool selection based on request complexity
- Connection Management - Built-in retry logic, timeouts, and health checks
- Tool Namespacing - Avoid conflicts with prefixed tool names (e.g.,
pg_,custom_) - Lifecycle Hooks - Monitor connections and tool usage
- Graceful Degradation - App works even if MCP servers are unavailable
-
Via Configuration File (Recommended)
Create
.mcp-config.jsonin the project root:{ "version": "1.0.0", "servers": [ { "id": "my-mcp", "name": "My Custom MCP", "transport": { "type": "http", "url": "https://mcp.example.com" }, "enabled": true, "priority": 50, "tags": ["custom"], "toolNamespace": "custom_" } ] } -
Via Code (For Built-in Servers)
Edit
src/lib/mcp/config.tsand add toBUILTIN_MCP_SERVERS:{ id: 'my-builtin-mcp', name: 'My Built-in MCP', transport: { type: 'http', url: 'https://mcp.example.com', }, enabled: true, priority: 50, tags: ['builtin'], toolNamespace: 'builtin_', }
-
Environment Variables
Override defaults:
MCP_CONFIG_PATH=./custom-mcp-config.json MCP_DISABLE_BUILTIN=false MCP_AUTO_CONNECT=true MCP_TIMEOUT=10000 MCP_RETRY_ATTEMPTS=2
- HTTP (Recommended for production) - RESTful API endpoint
- SSE - Server-Sent Events for streaming
- Stdio - Local servers via stdin/stdout (development only)
- MCP Architecture Documentation
- MCP Usage Guide
- MCP Quick Start
- Vercel AI SDK MCP Guide
- pg-aiguide GitHub - Built-in PostgreSQL knowledge by Timescale
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated!
- Fork the Project
- Create your Feature Branch
git checkout -b feature/AmazingFeature
- Commit your Changes
git commit -m 'feat: Add some AmazingFeature' - Push to the Branch
git push origin feature/AmazingFeature
- Open a Pull Request
We follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
- MCP Integration - Multi-server architecture for PostgreSQL knowledge
- Additional MCP Servers (pgvector, PostGIS, Supabase)
- Multi-schema support
- Multi-project support connected to GitHub repository
- Collaborative editing
- Schema versioning
- More export formats (JSON, YAML)
- Database connection for live schema sync
- Template library
- Advanced AI features (query generation, optimization)
- MCP Server UI management (enable/disable servers from UI)
See the open issues for a full list of proposed features and known issues.
Tiger SQL is optimized for performance with:
- ⚡ Virtual scrolling for large schemas
- 🧠 Efficient state management with Zustand
- 🔄 Optimized re-renders with React 19
- 💾 Smart caching strategies
- 📦 Code splitting and lazy loading
- 🎯 Memory leak prevention (tested with MemLab)
Special thanks to:
- Supabase - For the inspiration and type generation approach
- React Flow - Excellent flow diagram library
- shadcn/ui - Beautiful component library
- Vercel - Hosting and deployment
- All contributors who have helped improve Tiger SQL
If you find Tiger SQL helpful, consider supporting its development:
Your support helps maintain and improve Tiger SQL for everyone! ⭐
Distributed under the MIT License. See LICENSE.txt for more information.
Not associated with Supabase.
Jackson Kasi - @jacksonkasi0
Project Link: https://github.com/jacksonkasi1/tiger-sql
Made with ❤️ by Jackson Kasi
⭐ Star this repo if you find it useful!
