SQL Local MCP Server
Connects to MySQL databases and allows read-only SQL queries, table listing, and table structure inspection.
Connects to PostgreSQL databases and allows read-only SQL queries, table listing, and table structure inspection.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SQL Local MCP Server
A Model Context Protocol (MCP) server for executing SQL queries on MySQL and PostgreSQL databases. This allows Claude and other MCP-compatible AI assistants to connect to and interact with your local databases.
Features
Dynamic Database Connections: Connect to any MySQL or PostgreSQL database
READ-ONLY Security: Only SELECT, SHOW, DESCRIBE, and EXPLAIN queries are allowed
Multi-Statement Protection: Prevents SQL injection
Database Exploration: List tables and describe table structures
No Configuration Files: Database credentials are provided at runtime
Related MCP server: MCP MySQL
Installation
Clone the repository
Create and activate a virtual environment
Install dependencies:
pip install -r requirements.txt
Usage
Starting the Server
./start_server.shOr:
python3 mcp_server.pyAvailable Tools
connect_database: Connect to a MySQL or PostgreSQL database
execute_query: Execute READ-ONLY SQL queries
list_tables: List all tables in a database
describe_table: Get the structure of a table
Example: Connecting to a Database
To connect, provide the following details:
db_type:mysqlorpostgresqlhost:127.0.0.1port: (e.g., 3306 for MySQL, 5432 for PostgreSQL)user: your_userpassword: your_passworddatabase: your_dbconnection_name: a unique name for the connection
Security
Read-Only: Only
SELECT,SHOW,DESCRIBE,EXPLAINare allowed.Destructive commands are blocked:
UPDATE,DELETE,INSERT, etc.Multi-statement queries are blocked.
Parameterized queries are supported.
Testing
Basic tests:
python3 test_mcp.pySecurity tests:
python3 test_readonly.py
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides MySQL database integration for AI assistants and other MCP clients, allowing them to list tables, read table data, and execute SQL queries.-
- FlicenseAqualityBmaintenanceEnables AI assistants to connect to MySQL databases, execute read-only queries, list tables, and describe table schemas via MCP.101-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with PostgreSQL databases through a standardized MCP interface, supporting SQL queries, schema inspection, and database management.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to explore and run read-only queries across MySQL/MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, and MongoDB through MCP, with per-API-key database authorization, SQL whitelist and row/timeout limits, and a local web UI for managing connections and keys.Apache 2.0