SQL Server MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_NAME | No | Database name for single database configuration. | |
| DB_USER | No | SQL Server username for single database configuration. | |
| DB_SERVER | No | SQL Server host or instance for single database configuration. | |
| DB_PASSWORD | No | SQL Server password for single database configuration. | |
| DB_CONNECTIONS | No | JSON array string of connection objects. Used as an alternative to CONNECTIONS_FILE or individual DB_* variables. | |
| CONNECTIONS_FILE | No | Path 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
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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:
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
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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