SQL Query MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_HOST | Yes | Database host. Use host.docker.internal for Docker to access the host machine. | |
| DB_NAME | Yes | Database name. | |
| DB_PORT | Yes | Database port. Defaults vary by database: MSSQL 1433, MySQL 3306, PostgreSQL 5432. | |
| DB_TYPE | Yes | Database type. Options: mssql, mysql, postgres. | |
| DB_USER | Yes | Database username. | |
| DB_ENCRYPT | No | Set to true for Azure SQL. | false |
| DB_PASSWORD | Yes | Database password. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| execute_select_queryB | Execute a SELECT query on the database. Only SELECT queries are allowed for security. Returns the query results with rows and column information. |
| get_database_schemaB | Get the complete database schema including all tables and columns with their data types |
| list_tablesA | List all tables in the database |
| get_table_relationshipsA | Get foreign key relationships between tables. Shows which columns reference other tables, useful for understanding how to join tables and create complex queries. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 4 tools
Each tool has a distinct action: running queries, fetching full schema, listing table names, and fetching foreign-key relationships. There is mild redundancy since list_tables and get_table_relationships return subsets of what get_database_schema already covers, but the descriptions make the intended use of each clear.
All four tools follow a clean verb_noun pattern (execute_select_query, get_database_schema, list_tables, get_table_relationships) with consistent snake_case and imperative verbs.
Four tools is on the thin side but appropriate for a deliberately narrow, read-only query server where each tool covers a distinct introspection or execution need. Slight overlap suggests one could be trimmed, but nothing is bloated.
The core read-only workflow — discover tables, inspect schema and joins, then run SELECTs — is fully covered with no dead ends. Minor gaps like explain_query, sample-row previews, or column search exist but are workarounds via execute_select_query.