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.3.tar.gz (11.3 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.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for db_query_mcp-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f49fa3ae134e48c919e0cc8b5d6e1ee04136dd04670c2a0f28debbb61cb0be74
MD5 94e0d41b973f364b8acc2e7ac74c9cee
BLAKE2b-256 2e889346716821da675109bb3321570463bcf9aabff87365bdb949b00a4daa4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for db_query_mcp-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 12956774c49da63592a872cba3582e1b9546d7eb77ecd51dec2dcddfbff068bd
MD5 94a2f2fa2f2da944cb152cc0fef0a675
BLAKE2b-256 b53018abb12dc18b31cc2cea59c321bb211857563f2d8530baf0559870947699

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