Skip to main content
Glama
dkp5897

SQL Server MCP Server

by dkp5897

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_NAMENoDatabase name for single database configuration.
DB_USERNoSQL Server username for single database configuration.
DB_SERVERNoSQL Server host or instance for single database configuration.
DB_PASSWORDNoSQL Server password for single database configuration.
DB_CONNECTIONSNoJSON array string of connection objects. Used as an alternative to CONNECTIONS_FILE or individual DB_* variables.
CONNECTIONS_FILENoPath to a JSON file containing an array of connection objects. Used as an alternative to DB_CONNECTIONS.

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

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
sql_run_queryA

Execute a SELECT query against the configured SQL Server database and return formatted results. Only SELECT statements are allowed here — for writes, use sql_run_write.

sql_run_writeA

Execute a write SQL statement (INSERT, UPDATE, DELETE, DROP TABLE, ALTER TABLE, CREATE, TRUNCATE, EXEC stored proc, etc.).

IMPORTANT PERMISSION RULE:

  • When confirm is false (default): returns a DRY-RUN PREVIEW — nothing is executed.

  • When confirm is true: actually executes the statement.

Always call with confirm=false first to show the user what will happen, then call again with confirm=true only after the user explicitly approves.

sql_list_tablesA

List all user tables (and optionally views) in the active database, with row counts.

sql_inspect_tableA

Show full details about a table: columns with types/nullability/defaults, primary keys, foreign keys, indexes, and row count.

sql_list_stored_procsB

List all stored procedures in the active database.

sql_get_stored_proc_defC

Get the full definition (source code) of a stored procedure.

sql_find_dataA

Search for a value across all (or specific) columns in a table. Useful when you know a value exists but don't know which column it's in.

sql_check_foreign_keysA

Find foreign key violations in a table — records that reference non-existent parent rows (orphaned data). Very useful for diagnosing referential integrity issues.

sql_count_and_sampleB

Get the row count and a sample of rows from a table. Useful for quickly understanding what data exists without writing a full query.

sql_check_nullsB

Find rows with NULL values in specified columns. Useful for finding missing/incomplete data that might be causing bugs.

sql_compare_countsA

Compare row counts between a parent and child table (joined by FK) to detect missing or extra records. Useful for finding data gaps.

sql_diagnose_issueB

Run a comprehensive diagnostic on a table: counts, NULLs in all columns, FK violations, and recent rows. Great starting point when you notice something wrong.

sql_get_query_planA

Get the estimated execution plan for a SELECT query as text (SET SHOWPLAN_ALL). Useful for diagnosing slow queries.

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/dkp5897/sql-server-mcp'

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