Planned future support for querying Elasticsearch databases
Planned future support for connecting to and querying MongoDB databases
Supports querying MySQL databases with read-only access, enabling SQL generation and execution with data export capabilities
Enables connection to PostgreSQL databases for executing queries and exporting results with default read-only mode for data safety
Provides functionality to connect to and query SQLite databases with read-only access and data export features
[ 中文 | 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
Install from GitHub:
MySQL requires additional dependencies:
PostgreSQL requires additional dependencies:
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
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
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.
Related MCP Servers
- -securityFlicense-qualityProvides read-only access to PostgreSQL databases, enabling users to inspect database schemas and execute read-only queries through a Model Context Protocol server.Last updated -3JavaScript
- -securityAlicense-qualityDButils is an all-in-one MCP service that enables your AI to do data analysis by accessing versatile types of database (sqlite, mysql, postgres, and more) within a unified connection configuration in a safe way.Last updated -69PythonMIT License
- -securityFlicense-qualityProvides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only SQL queries within a secure transaction context.Last updated -16,948JavaScript
- -securityFlicense-qualityProvides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only SQL queries.Last updated -16,948JavaScript