Skip to main content
Glama
negrip

SQL Query Tools MCP Server

by negrip

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAX_ROWSNoMaximum rows returned per query.200
SQL_USERYesThe database user.
AUDIT_LOGNoSet to true to enable audit logging.false
SQL_SERVERYesThe SQL Server hostname or IP address.
SQL_ENCRYPTNoSet to true for Azure SQL or cloud servers.false
SQL_DATABASEYesThe database name.
SQL_INSTANCENoNamed instance of SQL Server (leave empty if default).
SQL_PASSWORDYesThe database password.
AUDIT_LOG_DIRNoDirectory for audit log files../logs
ALLOWED_TABLESNoComma-separated list of allowed tables/views (supports wildcards). Leave empty for all.
SQL_QUERY_TIMEOUTNoQuery timeout in milliseconds.30000
SQL_TRUST_SERVER_CERTNoSet to true to trust server certificate.true
SCHEMA_CACHE_TTL_MINUTESNoCache duration for schema in minutes.5

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
db_test_connectionA

Tests the connection to SQL Server and returns basic server information. Use this first to verify the server is reachable before running other tools.

db_describe_schemaA

Returns all available tables and views with their column count. Use this first to understand what data is available before writing queries. Results are cached to avoid repeated database calls.

db_describe_tableA

Returns full column details (name, data type, nullable) for a specific table or view. Use this when you need to know exact column names before writing a query.

db_sample_dataA

Returns 5 sample rows from a table or view. Use this to understand the actual data format, values and patterns before writing a more specific query.

db_run_readonlyA

Executes a SELECT query on SQL Server. Only read operations are allowed — write operations are blocked. TOP is automatically injected if no row limit is present. Use db_describe_schema and db_describe_table first if you are unsure about table or column names.

db_list_databasesA

Returns the currently connected database name and status.

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/negrip/mcp-sqlserver-readonly'

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