Skip to content
| Marketplace
Sign in
Visual Studio Code>Extension Packs>Database MCP AssistantNew to Visual Studio Code? Get it now.
Database MCP Assistant

Database MCP Assistant

btparker.work

|
4 installs
| (0) | Free
VS Code extension that connects GitHub Copilot to your database via Model Context Protocol
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code MCP Database Extension

A powerful VS Code extension that integrates with GitHub Copilot to provide database querying capabilities through the Model Context Protocol (MCP).

Features

  • 🤖 AI-Powered Database Assistant: Chat with your database using natural language through GitHub Copilot
  • 🔍 Intelligent SQL Generation: Convert natural language questions into SQL queries
  • 📊 Schema Exploration: Browse and understand your database structure
  • ⚡ Query Execution: Run SQL queries and see formatted results
  • 🔗 Multi-Database Support: Works with PostgreSQL, MySQL, SQLite, and SQL Server
  • 🛡️ Secure: Connection strings are stored securely in workspace settings

Installation

  1. Install the extension from the VS Code marketplace
  2. Configure your database connection using the command palette
  3. Start chatting with your database using @dba

Quick Start

1. Configure Database Connection

Open the Command Palette (Ctrl+Shift+P) and run:

Database MCP: Configure Database Connection

Choose your database provider and enter your connection string:

  • PostgreSQL: postgresql://username:password@localhost:5432/database_name
  • MySQL: mysql://username:password@localhost:3306/database_name
  • SQLite: path/to/database.db
  • SQL Server: mssql://username:password@localhost:1433/database_name

2. Test Your Connection

Run the command:

Database MCP: Test Database Connection

3. Start Using the Database Assistant

Open GitHub Copilot Chat and use @dba:

@dba show me the database structure
@dba find all users created last week
@dba count how many orders we have
@dba sample data from products table

Usage Examples

Natural Language Queries

  • @dba show me all customers from New York
  • @dba find the top 10 products by sales
  • @dba count users by registration month
  • @dba get recent orders from last 7 days

SQL Execution

Execute SQL directly by wrapping it in code blocks:

SELECT name, email FROM users 
WHERE created_at > '2024-01-01' 
LIMIT 10;

Schema Exploration

  • @dba show database schema
  • @dba describe the users table
  • @dba find tables with 'order' in the name

Commands

Command Description
Database MCP: Configure Database Connection Set up your database connection
Database MCP: Test Database Connection Verify your database connection
Database MCP: Show Database Schema Display complete schema in a new document

Configuration

The extension stores configuration in your workspace settings:

{
  "dbMcp.provider": "postgresql",
  "dbMcp.connectionString": "postgresql://user:pass@localhost:5432/mydb",
  "dbMcp.enabled": true
}

Security

  • Connection strings are stored in workspace settings (not globally)
  • Passwords are masked during input
  • No credentials are logged or transmitted outside your local environment

Requirements

  • VS Code 1.74.0 or higher
  • GitHub Copilot extension
  • Access to a supported database

Supported Databases

  • PostgreSQL (requires pg package)
  • MySQL (requires mysql2 package)
  • SQLite (requires sqlite3 package)
  • SQL Server (requires mssql package)

Troubleshooting

Connection Issues

  1. Connection Refused: Ensure your database server is running
  2. Authentication Failed: Check username/password in connection string
  3. Database Not Found: Verify database name is correct
  4. Permission Denied: Ensure user has appropriate database permissions

Common Solutions

  • Test connection using the built-in test command
  • Check your connection string format
  • Verify database server is accessible from your machine
  • Ensure required database drivers are installed

Development

To build and run locally:

# Clone the repository
git clone <repo-url>
cd vscode-mcp-database-extension

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Open in VS Code for debugging
code .

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Changelog

0.0.1

  • Initial release
  • Basic database connectivity
  • GitHub Copilot integration
  • Schema exploration
  • SQL query execution
  • Multi-database support
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft