sql-query-mcp

v0.4.1
sql-query-mcp Checked 2 days ago Published 5 months ago

Read-only SQL MCP server for PostgreSQL and MySQL.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_connections

List configured SQL connections by connection_id.

list_schemas

List visible schemas for a PostgreSQL connection.

ParameterTypeDescription
connection_id *string

list_databases

List visible databases for a MySQL or Hive connection.

ParameterTypeDescription
connection_id *string

list_tables

List tables and views for a resolved schema or database.

ParameterTypeDescription
connection_id *string
database
schema

describe_table

Describe columns, keys, and indexes for a table.

ParameterTypeDescription
connection_id *string
table_name *string
database
schema

run_select

Run a read-only SELECT or CTE query.

ParameterTypeDescription
connection_id *string
sql *string
limit

explain_query

Run EXPLAIN on a read-only SELECT or CTE query.

ParameterTypeDescription
connection_id *string
sql *string
analyzeboolean

get_table_sample

Fetch a small sample from a table for schema discovery.

ParameterTypeDescription
connection_id *string
table_name *string
database
limit
schema

export_query_file

Export a read-only query result to a local CSV or XLSX file.

ParameterTypeDescription
connection_id *string
output_path *string
sql *string
export_allboolean
file_name
formatstring
limit
overwriteboolean

start_query

Start an asynchronous read-only SELECT or CTE query.

ParameterTypeDescription
connection_id *string
sql *string
limit

get_query

Get asynchronous query status and paginated results when complete.

ParameterTypeDescription
query_id *string
limit
offsetinteger

cancel_query

Cancel a running asynchronous query.

ParameterTypeDescription
query_id *string

import_table_file

Import a local CSV or XLSX file into an existing table.

ParameterTypeDescription
connection_id *string
file_path *string
table_name *string
database
schema
sheet_name