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.4.tar.gz (11.6 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.4-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for db_query_mcp-0.0.4.tar.gz
Algorithm Hash digest
SHA256 efab419b4bdbda69996457c16e14b64cfbb1f5d11ca43c140ec3170d85c8e39b
MD5 38820459f61fbcf6617aec3a830fc55f
BLAKE2b-256 6a61be07bf56530baf997f1a3c4f5d0c26fba55bf31acab0235b2e15bf378c9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for db_query_mcp-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8b29b0539ba5f10e6a904f7798eadfc0b218a923dd6c1ec167041c4c4f979763
MD5 a6df97ae4c3e09840eb12c1696dc0a35
BLAKE2b-256 610a4efa2d925ff98236e38a80ecbd8d9984eef9d3e7a2d4181310025387c102

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