Skip to main content

db-query-mcp is an MCP tool that enables data querying and export operations across diverse databases.

Project description

image

Python Version License PyPI GitHub pull request

[ 中文 | English ]

db-query-mcp

Introduction

db-query-mcp is an MCP tool that enables data querying and export operations across diverse databases, featuring:​

  • 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.5.tar.gz (13.1 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.5-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for db_query_mcp-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fe1840435e60d55d3a119b75dd7d043530554a3d14056790b9cddee4284747c0
MD5 9fc2e7e02cc37f502b21ee30953e681a
BLAKE2b-256 d5b2fb1c0e43e7927bccfb1fc18cfa9fa12725b5136533e0374d5207cefc3526

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for db_query_mcp-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0d40246aa5f208174d611528e49e6d69e36460624501fa24a0120cc097154b95
MD5 4e495f2b5976dd034c5da0a399a4f380
BLAKE2b-256 3b95eccbdcfe3b3aebf0bca04f594afb1576385e221a2c2796b10c474855d827

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