JUHE API Marketplace
NewToolAI avatar
MCP Server

Database Query MCP

A versatile tool that enables querying and exporting data from multiple relational databases (MySQL, PostgreSQL, Oracle, SQLite, etc.) in read-only mode for data safety.

6
GitHub Stars
11/23/2025
Last Updated
MCP Server Configuration
1{
2 "name": "sqlite_db_mcp",
3 "command": "uvx",
4 "args": [
5 "db-query-mcp",
6 "--db",
7 "sqlite",
8 "--uri",
9 "sqlite:///sqlite_company.db"
10 ]
11}
JSON11 lines
  1. Home
  2. MCP Servers
  3. db-query-mcp

README Documentation

image

[ English | 中文 ]

db-query-mcp

Introduction

db-query-mcp is a mcp tool supporting diverse database querying and exporting, featuring:

  • Multi-DB Support: Full compatibility with mainstream databases (ElasticSearch, MySQL, PostgreSQL, Oracle, SQLite, etc.)
  • Secure Access: Default read-only mode for data protection
  • Smart Query: Natural language to SQL conversion with query optimization
  • Data Export: CSV / Json export capabilities
  • Roadmap: Expanding support for MongoDB and GraphDatabase to become full-stack DB query MCP

Demo

https://github.com/user-attachments/assets/60771cda-8b52-41bd-90e3-523c836f6366

Changelog

  • 2025-06-02: Added support for ElasticSearch database queries

Installation

pip install db-query-mcp

ElasticSearch:

pip install "db-query-mcp[elasticsearch]"

Install from GitHub:

pip install git+https://github.com/NewToolAI/db-query-mcp

MySQL requires additional dependencies:

pip install pymysql

PostgreSQL requires additional dependencies:

pip install psycopg2-binary

For other databases, install their respective connection packages:

DatabaseConnection PackageExample Connection String
SQLiteBuilt-in Pythonsqlite:///example.db
MySQLpymysql or mysql-connector-pythonmysql+pymysql://user:password@localhost/dbname
PostgreSQLpsycopg2 or psycopg2-binarypostgresql://user:password@localhost:5432/dbname
Oraclecx_Oracleoracle+cx_oracle://user:password@hostname:1521/sidname
SQL Serverpyodbc or pymssqlmssql+pyodbc://user:password@hostname/dbname

Configuration

Note: ​For certain clients, such as Cursor, only one db-query-mcp server can run at a time.​​

Run using uvx

{
  "mcpServers": {
      "sqlite_db_mcp": {
        "command": "uvx",
        "args": [
          "db-query-mcp",
          "--db",
          "sqlite",
          "--uri", 
          "sqlite:///sqlite_company.db"
        ]
      }
  }
}
{
  "mcpServers": {
      "es_db_mcp": {
        "command": "uvx",
        "args": [
          "db-query-mcp",
          "--db",
          "elasticsearch",
          "--uri", 
          "https://user:password@localhost:9200?index=test_data_index&ca_certs=/home/user/http_ca.crt"
        ]
      }
  }
}

Run Using command

{
  "mcpServers": {
      "sqlite_db_mcp": {
        "command": "db-query-mcp",
        "args": [
          "--db",
          "sqlite",
          "--uri", 
          "sqlite:///sqlite_company.db"
        ]
      }
  }
}
{
  "mcpServers": {
      "es_db_mcp": {
        "command": "db-query-mcp",
        "args": [
          "--db",
          "elasticsearch",
          "--uri", 
          "https://user:password@localhost:9200?index=test_data_index&ca_certs=/home/user/http_ca.crt"
        ]
      }
  }
}

Quick Install

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.ai
Copyright © 2025 - All rights reserved