Skip to main content

Add your description here

Project description

image

Python Version License PyPI GitHub pull request

[ 中文 | English ]

db-query-mcp

Introduction

db-query-mcp is a versatile Database Query MCP tool with the following core features:

  • Multi-Database Support: Full compatibility with mainstream relational databases (MySQL, PostgreSQL, Oracle, SQLite, etc.)
  • Secure Access: Default read-only mode connection ensures data safety
  • Smart Query: Provides efficient SQL generation and execution capabilities
  • Data Export: Supports query result export functionality
  • Future versions will expand support for Elasticsearch, MongoDB, and graph databases, aiming to become a full-stack database query solution.

Demo

https://github.com/user-attachments/assets/51d0e890-27b2-411d-b5c3-e748599a9543

Installation

pip install db-query-mcp

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:

Database Connection Package Example Connection String
SQLite Built-in Python sqlite:///example.db
MySQL pymysql or mysql-connector-python mysql+pymysql://user:password@localhost/dbname
PostgreSQL psycopg2 or psycopg2-binary postgresql://user:password@localhost:5432/dbname
Oracle cx_Oracle oracle+cx_oracle://user:password@hostname:1521/sidname
SQL Server pyodbc or pymssql mssql+pyodbc://user:password@hostname/dbname

Configuration

{
  "mcpServers": {
    "db_query_mcp": {
      "command": "db-query-mcp",
      "args": [
        "--db",
        "mysql+pymysql://user:password@host:port/database"
      ]
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

db_query_mcp-0.0.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

db_query_mcp-0.0.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file db_query_mcp-0.0.2.tar.gz.

File metadata

  • Download URL: db_query_mcp-0.0.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for db_query_mcp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d32e55e8369540cb796cba6daff547d1104ecde5fdaecff91588517cb1763b89
MD5 6a470100ebb670a2dfd87c8220095767
BLAKE2b-256 74d58f3bfb783a750f1b912766d2936d4254685466616f6cc7f807724d52f448

See more details on using hashes here.

File details

Details for the file db_query_mcp-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for db_query_mcp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9884adc30587cc1db6997192c05f7f09ae3624b5ea6bc032c8fc56a1654f2f
MD5 98b41c67d7bc058a847a44ff20678d54
BLAKE2b-256 9be67ab5a3503287610466389def2f1ee3961c994f75703e70bae593d74132e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page