Skip to main content
Glama
akrym1582

sqldb-mcp-server

by akrym1582

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_HOSTYesDatabase server hostname
DB_NAMEYesDatabase name
DB_PORTNoDatabase server port (default depends on DB_TYPE: 1433 for mssql, 5432 for postgresql, 3306 for mysql)
DB_TYPENoDatabase type: mssql, postgresql, or mysqlmssql
DB_USERYesDatabase username
CACHE_TTLNoCache TTL in seconds60
DB_ENCRYPTNoEnables encrypted DB connectionstrue for MSSQL/PostgreSQL, false for MySQL
DB_PASSWORDYesDatabase password
DB_QUERY_TIMEOUTNoQuery timeout in milliseconds30000
EXPORT_QUERY_TIMEOUTNoExport query timeout in milliseconds300000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
queryA

Execute a read-only SELECT SQL query. Returns results in a compact column/row format to reduce token usage. Results are capped at 100 rows; use skip/take for pagination. The meta.totalCount field shows the total number of matching rows.

listTablesA

List all base tables in the database, returning their schema and name.

describeTableA

Describe a table: returns columns (name, type, nullability, primary key, identity), indexes, foreign keys, check constraints, and table-level size/row-count statistics.

explainQueryA

Return the estimated execution plan for a SELECT SQL query without actually executing it. The response format depends on the database engine (e.g. MSSQL, PostgreSQL, MySQL) and is returned as-is from the database driver.

exportQueryA

Execute a read-only SELECT SQL query and stream the results to a file. Supports CSV and JSON output formats. Designed for large datasets – results are streamed directly to disk without a row-count limit. CSV options: delimiter (default ','), nullValue (default ''), bom (default false). JSON options: pretty (default false). Timeout is controlled by the EXPORT_QUERY_TIMEOUT environment variable (default: 300 s).

saveQueryEvidenceA

Execute a read-only SELECT SQL query and save the SQL plus the results as a Markdown report file. Returns the saved file path, the total number of rows fetched, and the first 10 rows as preview data.

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/akrym1582/sqldb-mcp-server'

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