Skip to main content
Glama
teghoz

sql-mcp

by teghoz

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PORTNoPort for HTTP mode (e.g., 3000).
PG_SSLNoWhether to use SSL for PostgreSQL.false
PG_HOSTNoPostgreSQL host.
PG_PORTNoPostgreSQL port.5432
PG_USERNoPostgreSQL user.
SQL_PORTNoSQL Server port.1433
SQL_USERNoSQL Server login.
SQL_SERVERNoSQL Server hostname.
DB_PROVIDERNoDatabase provider: 'mssql' (default) or 'postgres'.mssql
PG_DATABASENoDefault database for PostgreSQL.
PG_PASSWORDNoPostgreSQL password.
SQL_ENCRYPTNoWhether to encrypt SQL Server connections.false
SQL_DATABASENoDefault database for SQL Server.
SQL_MAX_ROWSNoHard cap on rows returned.5000
SQL_PASSWORDNoSQL Server password.
AUDIT_DATABASENoDatabase name for audit SQL sink (reusing main connection params).
AUDIT_LOG_PATHNoDirectory for audit log files.logs/
PG_AZURE_AD_AUTHNoSet to 'true' for Azure AD authentication (no PG_PASSWORD needed).
SQL_BLOCKED_TABLESNoComma-separated schema.table pairs to block.
SQL_MASKED_COLUMNSNoComma-separated schema.table.column values to mask.
SQL_ALLOWED_SCHEMASNoComma-separated list of allowed schemas.
SQL_REQUEST_TIMEOUTNoQuery timeout in ms.30000
PG_CONNECTION_STRINGNoPostgreSQL connection string.
PG_STATEMENT_TIMEOUTNoQuery timeout in ms.30000
SQL_CONNECTION_STRINGNoFull ADO.NET connection string for SQL Server. When set, individual SQL_* parameters are ignored.
AUDIT_CONNECTION_STRINGNoConnection string for audit SQL sink.
SQL_TRUST_SERVER_CERTIFICATENoWhether to trust server certificate.true

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_databasesA

List all online databases on the SQL Server instance

list_schemasB

List all schemas in a database

list_tablesA

List all tables in a database, optionally filtered by schema

describe_tableB

Get column definitions for a table

get_table_indexesA

Get all indexes defined on a table

get_foreign_keysB

Get all foreign key relationships for a table

list_viewsB

List all views in a database, optionally filtered by schema

describe_viewA

Get column definitions and the SQL definition for a view

list_stored_proceduresA

List all stored procedures in a database, optionally filtered by schema

get_stored_procedure_definitionB

Get the full source definition of a stored procedure

list_synonymsA

List all synonyms in a database, optionally filtered by schema

get_synonym_definitionB

Get the base object a synonym points to

list_functionsA

List all user-defined functions in a database (scalar, inline table-valued, and multi-statement table-valued), optionally filtered by schema

get_function_definitionA

Get the full source definition of a user-defined function

list_triggersA

List all DML triggers in a database, optionally filtered by schema and/or parent table

get_trigger_definitionA

Get the full source definition of a DML trigger

get_table_constraintsA

Get all constraints on a table: PRIMARY KEY, UNIQUE, CHECK, and DEFAULT

get_extended_propertiesA

Get all extended properties (e.g. MS_Description documentation) for a table, view, procedure, or function — includes both the object-level and all column-level properties

list_sequencesA

List all sequences in a database, optionally filtered by schema. Shows data type, range, increment, cycling, and current value.

get_table_statsA

Get row count and disk space usage (total, used, unused) for a table

list_database_usersA

List all users in a database with their type, default schema, and mapped login

list_database_rolesA

List all database roles and their members. Uses LEFT JOIN so roles with no members are included.

get_object_permissionsA

Get all explicit permissions granted on a specific database object

get_server_propertiesA

Get SQL Server instance properties: version, edition, collation, clustering, and HA configuration

list_linked_serversA

List all linked servers configured on the SQL Server instance. Requires VIEW ANY DEFINITION or sysadmin — will return an empty result set if the login lacks this permission.

list_agent_jobsA

List all SQL Server Agent jobs with their enabled state, category, owner, and last run outcome. Requires membership in SQLAgentUserRole (or higher) in the msdb database.

get_job_historyA

Get execution history for a SQL Server Agent job. Requires membership in SQLAgentUserRole (or higher) in the msdb database.

list_partition_functionsA

List all partition functions in the current database, including range type, partition count, and boundary values

list_partition_schemesA

List all partition schemes in the current database, showing which partition function each uses and the mapped filegroups

list_fulltext_catalogsA

List all full-text search catalogs in a database with item count, size, and populate status

list_fulltext_indexesA

List all full-text indexes in a database, showing the catalog, indexed columns, and change-tracking state

list_service_queuesA

List all Service Broker queues in a database, optionally filtered by schema

list_broker_servicesA

List all Service Broker services in a database and the queue each binds to

list_user_typesA

List all user-defined types (scalar alias types and table types) in a database, optionally filtered by schema

get_table_type_columnsA

Get the column definitions for a user-defined table type

list_temporal_tablesA

List all system-versioned temporal tables in a database, showing the linked history table for each

execute_queryA

Execute a read-only SELECT query against the SQL Server. Only SELECT statements (and CTEs using WITH) are permitted. Use TOP or FETCH NEXT in your query for large tables to avoid excessive data transfer. Results are capped at 1000 rows by default.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teghoz/sql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server