Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Transports: stdio vs HTTP
  • State of MCP (stats)
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI → MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE ↗ (opens in a new tab)
  • llms.txt ↗ (opens in a new tab)
  • Catalog JSON ↗ (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub ↗ (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. 🗄️ Databases
  3. MCP Database Server
MCP Database Server logo
Health: ActiveRecent health check succeeded.Last checked 9/22/2026, 11:31:20 PM

MCP Database Server

User RatingsBe the first to rate and review this MCP server! Enrichment pendingWe haven’t run our AI enrichment pass on this listing yet, so the overview, use cases, and FAQ below may be sparse or missing. We work through the catalog over time — check back soon.
View Repository19 GitHub StarsTotal stargazers on GitHub for the source repository (19 stars).Visit Website

MCP server for SQLite, PostgreSQL, and MySQL with natural language to SQL and direct SQL tooling.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.

One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.

Manual Client & Custom JSON ConfigExpand JSON ▾
No confirmed setup config for this listing yet. We only publish a config block when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for MCP Database Server, and we’d rather show nothing than a guess you’d paste into your client. Follow the project’s own setup instructions for the current steps.
Install Directory Badge Claim listing Alternatives🗄️ More in Databases

Documentation Overview

mcp-db-server

License Python mcpindex verdict

An MCP (Model Context Protocol) server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language query support. Transform natural language questions into SQL queries and get structured results.

Features

  • Multi-Database Support: Works with PostgreSQL and MySQL
  • Natural Language to SQL: Convert plain English queries to SQL using HuggingFace transformers
  • RESTful API: Clean FastAPI-based endpoints for database operations
  • Safety First: Read-only operations with query validation and result limits
  • Docker Ready: Complete containerization with Docker Compose
  • Production Ready: Health checks, logging, and error handling
  • AI Agent Friendly: Designed specifically for AI agent integration

Version 1.4.0 Changes

  • Added mandatory X-API-Key authentication for all database HTTP endpoints; /health remains public for health checks.
  • Removed unrestricted credentialed CORS and made allowed origins explicitly configurable.
  • Changed the default HTTP bind address to 127.0.0.1.
  • Added table-name validation against existing database tables to block SQL injection through table routes.
  • Added PostgreSQL sslmode=require compatibility for asyncpg connections.
  • Updated Docker Compose, environment examples, and documentation for secure API-key configuration.
  • Published Docker images:
    • souhardyak/mcp-db-server:1.4.0
    • souhardyak/mcp-db-server:latest
  • Added GitHub Container Registry publishing for:
    • ghcr.io/souhar-dya/mcp-db-server:1.4.0
    • ghcr.io/souhar-dya/mcp-db-server:latest

API Endpoints

EndpointMethodDescription
/healthGETHealth check and service status
/mcp/list_tablesGETList all available tables with column counts
/mcp/describe/{table_name}GETGet detailed schema for a specific table
/mcp/queryPOSTExecute natural language queries
/mcp/tables/{table_name}/sampleGETGet sample data from a table

Quick Start

Option 1: Docker Compose (Recommended)

  1. Clone and start the services:

    server.ts
    git clone https://github.com/Souhar-dya/mcp-db-server.git
    cd mcp-db-server
    export MCP_API_KEY="$(openssl rand -hex 32)"
    docker-compose up --build
    
  2. Test the endpoints:

    bash
    # Health check
    curl http://localhost:8000/health
    
    # List tables (requires the configured API key)
    curl -H "X-API-Key: $MCP_API_KEY" http://localhost:8000/mcp/list_tables
    
    # Describe a table
    curl -H "X-API-Key: $MCP_API_KEY" http://localhost:8000/mcp/describe/customers
    
    # Natural language query
    curl -X POST "http://localhost:8000/mcp/query" \
      -H "X-API-Key: $MCP_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"nl_query": "show top 5 customers by total orders"}'
    

Option 2: Local Development

  1. Prerequisites:

    • Python 3.11+
    • PostgreSQL or MySQL database
  2. Install dependencies:

    Terminal
    pip install -r requirements.txt
    
  3. Set environment variables:

    server.ts
    export DATABASE_URL="postgresql+asyncpg://user:password@localhost:5432/dbname"
    export MCP_API_KEY="$(openssl rand -hex 32)"
    # or for MySQL:
    # export DATABASE_URL="mysql+pymysql://user:password@localhost:3306/dbname"
    
  4. Run the server:

    bash
    python -m app.server
    

Sample Database

The project includes a sample database with realistic e-commerce data:

  • customers: Customer information (10 sample customers)
  • orders: Order records (17 sample orders)
  • order_items: Individual items within orders
  • order_summary: View combining order and customer data

Natural Language Query Examples

The server can understand various types of natural language queries:

bash
# Get all customers
curl -X POST "http://localhost:8000/mcp/query" \
  -H "Content-Type: application/json" \
  -d '{"nl_query": "show all customers"}'

# Count orders by status
curl -X POST "http://localhost:8000/mcp/query" \
  -H "Content-Type: application/json" \
  -d '{"nl_query": "count orders by status"}'

# Top customers by order value
curl -X POST "http://localhost:8000/mcp/query" \
  -H "Content-Type: application/json" \
  -d '{"nl_query": "top 5 customers by total order amount"}'

# Recent orders
curl -X POST "http://localhost:8000/mcp/query" \
  -H "Content-Type: application/json" \
  -d '{"nl_query": "show recent orders from last week"}'

Configuration

Environment Variables

VariableDescriptionDefault
DATABASE_URLFull database connection URLpostgresql+asyncpg://postgres:postgres@localhost:5432/postgres
DB_HOSTDatabase hostlocalhost
DB_PORTDatabase port5432
DB_USERDatabase usernamepostgres
DB_PASSWORDDatabase passwordpostgres
DB_NAMEDatabase namepostgres
HOSTServer host127.0.0.1
PORTServer port8000
MCP_API_KEYRequired API key for database HTTP routesNot set (API disabled)
CORS_ALLOW_ORIGINSComma-separated allowed browser originsEmpty (disabled)

Database Connection Examples

bash
# PostgreSQL
DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/mydb

# MySQL
DATABASE_URL=mysql+pymysql://user:pass@localhost:3306/mydb

# PostgreSQL with SSL
DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/mydb?sslmode=require

### Database Connection Examples

```bash
# PostgreSQL (local or cloud)
DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname

# MySQL (local or cloud)
DATABASE_URL=mysql+aiomysql://user:password@host:3306/dbname

# PostgreSQL with SSL (cloud, e.g. Neon, Supabase, Aiven)
DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname?sslmode=require

# MySQL with SSL (cloud, e.g. Aiven, PlanetScale)
DATABASE_URL=mysql+aiomysql://user:password@host:3306/dbname?ssl-mode=REQUIRED

Note:

  • For MySQL cloud providers, the ssl-mode parameter in the URL is ignored by the driver, but SSL is always enabled in the MCP server for cloud connections.
  • For PostgreSQL, use sslmode=require for cloud DBs. For MySQL, just use the standard URL; SSL is handled automatically.
  • If you see errors about ssl-mode or sslmode, check your URL and ensure you are using the correct driver prefix (mysql+aiomysql or postgresql+asyncpg).

Cloud Database Examples

bash
# Neon (PostgreSQL)
DATABASE_URL=postgresql+asyncpg://username:password@ep-xxxxxx-pooler.us-east-2.aws.neon.tech/dbname

# Aiven (MySQL)
DATABASE_URL=mysql+aiomysql://avnadmin:yourpassword@mysql-xxxxxx-username-xxxx.aivencloud.com:11079/defaultdb?ssl-mode=REQUIRED

Docker Usage with Cloud DB

Terminal
docker run -d \
  -p 8000:8000 \
  -e DATABASE_URL="<your_cloud_database_url>" \
  -e MCP_API_KEY="<your_random_api_key>" \
  souhardyak/mcp-db-server:latest

GitHub Container Registry is also available:

Terminal
docker login ghcr.io
docker pull ghcr.io/souhar-dya/mcp-db-server:latest
docker run -d \
  -p 8000:8000 \
  -e DATABASE_URL="<your_database_url>" \
  -e MCP_API_KEY="$MCP_API_KEY" \
  ghcr.io/souhar-dya/mcp-db-server:latest

Images are published automatically when a v*.*.* tag is pushed. The workflow also creates the matching GitHub Release. To publish an existing tag such as v1.4.0, open the workflow's Run workflow action and enter 1.4.0. Set the GHCR package visibility to Public in the repository's Packages settings if unauthenticated pulls should be allowed.

Troubleshooting

  • If you get connect() got an unexpected keyword argument 'ssl-mode', ignore it: SSL is still enabled.
  • For network errors, check firewall and DB credentials.
  • For MySQL, always use mysql+aiomysql in the URL for async support.
Code

### PostgreSQL SSL connection note

For PostgreSQL cloud providers, use an asyncpg URL and `sslmode=require`:

```bash
DATABASE_URL=postgresql+asyncpg://user:password@host:5432/dbname?sslmode=require

The server normalizes sslmode=require to the ssl option expected by asyncpg. A temporary PostgreSQL verification was completed successfully against a compatible cloud database using CREATE, INSERT, SELECT, UPDATE, DELETE, and DROP; no test data was retained. Never commit or share a connection URL containing a real password.

API key authentication

Read the full README →View source on GitHub →

Related MCP Servers

View all in Databases View all alternatives
  • Database MCP logoDatabase MCP

    MCP server for database connectivity. Multi-DB (PostgreSQL, MySQL, SQLite), 19 tools.

    🗄️ Databases1 views
    Compare vs Database MCP →
  • Pg Aiguide logoPg Aiguide

    Comprehensive PostgreSQL documentation and best practices, including ecosystem tools

    🗄️ Databases0 views
    Compare vs Pg Aiguide →
  • MCP Sql Rust logoMCP Sql Rust

    Token-efficient MCP server for MySQL, PostgreSQL, and SQLite

    🗄️ Databases0 views
    Compare vs MCP Sql Rust →
  • Strut Stack Sql logoStrut Stack Sql

    Token-efficient MCP server for MySQL, PostgreSQL, and SQLite

    🗄️ Databases0 views
    Compare vs Strut Stack Sql →

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars
19
Stargazers on the source repository.
Last commit
11d ago
Most recent push to the default branch.
Directory activity
1 views
Config copies, upvotes, and views on AllMCPs.

Reviews

No reviews yet — be the first to share how this listing worked for you.

Frequently Asked Questions about MCP Database Server

We don't have a confirmed install command for MCP Database Server yet, so we don't publish a generated one — a guessed package name would point at the wrong package or none at all. Follow the project's own README or setup instructions (https://github.com/Souhar-dya/mcp-db-server) for the current steps.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Database Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-database-server?style=directory)](https://allmcps.com/mcp/mcp-database-server)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-database-server"><img src="https://allmcps.com/api/badge/mcp-database-server?style=directory" alt="MCP Database Server on AllMCPs" /></a>

Technical Specs & Signals

Category🗄️Databases
More technical detailsExpand ▾
Last updatedSep 13, 2026
11/14 checks healthy over the last 45d
Views1
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars19
GitHub Star CountTotal stargazers on GitHub representing community popularity (19 stars).
Last commit11d ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on Sep 13, 2026
36Quality signal: Fair · 36/100How this signal is calculated ▾
Server availabilityNot measured

Not scored for repo-hosted servers — we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools11/30
Adoption & activity6/15
Community engagement0/10

A guidance signal from public completeness & health data — not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge — proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it — no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in 🗄️ Databases →Best MCP servers for Databases →Best PostgreSQL MCP servers →Best SQLite MCP servers →Best MySQL MCP servers →Alternatives to MCP Database Server →Install in Claude DesktopInstall in CursorInstall in VS CodeSetup guides for all 13 MCP clients