mcp-db-universal
Enables database interaction via natural language within GitHub Copilot Agent mode.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-db-universal What are the top 5 best-selling products?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-db-universal
A database-agnostic MCP (Model Context Protocol) server that lets you chat with your database through Claude or GitHub Copilot. Ask questions in plain English and the AI will write and execute the SQL for you.
Supported Databases
Database | Driver | Install |
PostgreSQL |
|
|
MySQL |
|
|
SQL Server |
|
|
SQLite |
|
|
Oracle |
|
|
Related MCP server: nl2sql-mcp
Quick Start
0. Prerequisites — Install Node.js
This tool runs on Node.js. If you don't have it installed, do that first:
Go to nodejs.org and download the LTS version (recommended for most users)
Run the installer and follow the prompts
Once installed, open a terminal (Command Prompt / PowerShell on Windows, Terminal on macOS/Linux) and verify it worked:
node --version # should print something like v20.x.x
npm --version # should print something like 10.x.xIf both commands return version numbers, you're good to go
1. Install globally
npm install -g fm-db-mcp-universal
# Then install your DB driver:
npm install -g pg # PostgreSQL
npm install -g mysql2 # MySQL
npm install -g mssql tedious # SQL Server
npm install -g better-sqlite3 # SQLite
npm install -g oracledb # Oracle2. Connect to Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"my-db": {
"command": "npx",
"args": ["fm-db-mcp-universal"],
"env": {
"DB_CLIENT": "oracle",
"DB_HOST": "localhost",
"DB_PORT": "1521",
"DB_NAME": "orcl",
"DB_USER": "xxx",
"DB_PASSWORD": "xxx"
}
}
}
}3. Connect to VS Code (GitHub Copilot Agent mode)
Create .vscode/mcp.json in your workspace:
{
"servers": {
"oracle-db": {
"command": "npx",
"args": [
"fm-db-mcp-universal"
],
"env": {
"DB_CLIENT": "oracle",
"DB_HOST": "localhost",
"DB_PORT": "1521",
"DB_NAME": "orcl",
"DB_USER": "FMCPROD1",
"DB_PASSWORD": "FMCPROD1"
}
},
"postgres-db": {
"command": "npx",
"args": [
"fm-db-mcp-universal"
],
"env": {
"DB_CLIENT": "postgres",
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_USER": "postgres",
"DB_PASSWORD": "password",
"DB_NAME": "postgres"
}
},
"mssql-db": {
"command": "npx",
"args": [
"fm-db-mcp-universal"
],
"env": {
"DB_CLIENT": "mssql",
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USER": "sa",
"DB_PASSWORD": "sadmin",
"DB_NAME": "ALLMERGE"
}
},
}
}Configuration
All configuration is via environment variables:
Variable | Description | Default |
| Database type: |
|
| Database host |
|
| Database port (auto-detected if not set) | per DB |
| Username | — |
| Password | — |
| Database name | — |
| File path (SQLite only) | — |
| Full connection string (overrides above) | — |
| Set |
|
| Connection pool minimum |
|
| Connection pool maximum |
|
Using a Connection String
{
"env": {
"DB_CLIENT": "postgres",
"DB_CONNECTION_STRING": "postgresql://user:pass@localhost:5432/mydb"
}
}Database-Specific Examples
PostgreSQL
{
"DB_CLIENT": "postgres",
"DB_HOST": "localhost",
"DB_USER": "postgres",
"DB_PASSWORD": "secret",
"DB_NAME": "myapp"
}MySQL / MariaDB
{
"DB_CLIENT": "mysql",
"DB_HOST": "localhost",
"DB_USER": "root",
"DB_PASSWORD": "secret",
"DB_NAME": "myapp"
}SQL Server (MSSQL)
{
"DB_CLIENT": "mssql",
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USER": "sa",
"DB_PASSWORD": "YourPassword123!",
"DB_NAME": "Northwind"
}SQLite
{
"DB_CLIENT": "sqlite",
"DB_FILENAME": "/path/to/database.db"
}Oracle
{
"DB_CLIENT": "oracle",
"DB_HOST": "localhost",
"DB_PORT": "1521",
"DB_USER": "myuser",
"DB_PASSWORD": "mypassword",
"DB_NAME": "ORCL"
}Available MCP Tools
Tool | Description |
| Test connection and confirm it's working |
| Run a SELECT query (read-only, auto-limited to 100 rows) |
| Run INSERT/UPDATE/DELETE/DDL (disabled in read-only mode) |
| List all tables and views |
| Get columns, types, nullability for a table |
| Get index information for a table |
| Get foreign key relationships for a table |
| Full schema dump of all tables at once |
Example Chat Interactions
Once connected, just talk naturally:
"What tables do I have?" → Calls
db_list_tables
"Show me all users who signed up in the last 30 days" → Writes and executes a SELECT with date filter
"How many orders are in 'pending' status?" → COUNT query
"What's the schema of the orders table?" → Calls
db_describe_table
"Add an index on users.email" → Calls
db_executewith CREATE INDEX statement
"Give me a summary of sales by region this year" → GROUP BY query with aggregation
Read-Only Mode
To protect production databases, enable read-only mode:
{
"env": {
"DB_READONLY": "true",
...
}
}In read-only mode, db_execute is disabled — only SELECT queries are allowed.
Running from Source
git clone https://github.com/yourname/mcp-db-universal
cd mcp-db-universal
npm install
npm install better-sqlite3 # or your DB driver
npm run buildThen configure Claude/Copilot to use:
{
"command": "node",
"args": ["/path/to/mcp-db-universal/dist/index.js"],
"env": { ... }
}Or run directly in dev mode:
DB_CLIENT=sqlite DB_FILENAME=./test.db npm run devPublishing to npm
npm run build
npm publishUsers can then use npx:
{
"command": "npx",
"args": ["mcp-db-universal"],
"env": { ... }
}License
MIT
Available Tools
8 toolsdb_describe_tableA
Get the schema of a table: columns, types, nullability, defaults
Inputs: table (required).
db_executeA
Execute a write SQL statement: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP. Disabled in read-only mode.
Inputs: sql (required).
db_foreign_keysA
Get foreign key relationships for a table
Inputs: table (required).
db_list_tablesA
List all tables and views in the database
Inputs: no named parameters.
db_pingA
Test the database connection and return connection info
Inputs: no named parameters.
db_queryA
Execute a SELECT SQL query and return results. Use this for all read operations.
Inputs: sql (required), limit.
db_schema_snapshotA
Get a full schema snapshot of all tables and their columns. Useful for understanding the entire DB structure at once.
Inputs: no named parameters.
db_table_indexesA
Get indexes for a table
Inputs: table (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools are clearly distinct: ping, query, execute, and metadata operations each have a clear purpose. There is minor overlap between list_tables and schema_snapshot, but the descriptions clarify that one returns only table names while the other returns full column-level detail.
All tools share the db_ prefix and use snake_case, which is good, but the pattern is mixed: some are verb_noun (list_tables, describe_table), some are verb-only (ping, query, execute), and some are noun-only (table_indexes, foreign_keys, schema_snapshot). This is readable but not a consistent verb_noun convention.
Eight tools is a well-scoped size for a universal database server. Each tool covers a distinct need: connection testing, read/write SQL execution, and schema/table metadata exploration.
The tool set covers the full database lifecycle: connect, inspect available tables, view schema details, query data, and execute writes and DDL. The generic db_query and db_execute tools avoid dead ends for read and write operations.
Maintenance
Related MCP Connectors
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP (Model Context Protocol) server that exposes natural language to SQL functionality, allowing any MCP-compatible client to convert plain English questions into SQL queries for database interaction using AI.3MIT
- FlicenseNot gradedqualityFmaintenanceA production-ready MCP server that transforms natural language into safe, executable SQL queries with multi-database support and intelligent schema analysis.1-
- FlicenseNot gradedqualityBmaintenanceAn MCP server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language to SQL query support.19-
- -licenseNot gradedqualityDmaintenanceAn MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.3-