Skip to main content
Glama
bymcs

MS SQL Server MCP Server

by bymcs

MS SQL Server MCP Server v2.3.6

๐Ÿš€ Model Context Protocol (MCP) server for Microsoft SQL Server - compatible with Claude Desktop, Cursor, Windsurf and VS Code.

CI npm version License: MIT

Standards Alignment

Related MCP server: MSSQL MCP Server

๐Ÿš€ Quick Start

1. Install

npm install -g mssql-mcp

2. Configure IDE

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "mssql": {
      "command": "npx",
      "args": ["-y", "mssql-mcp@latest"],
      "env": {
        "DB_SERVER": "your-server.com",
        "DB_DATABASE": "your-database",
        "DB_USER": "your-username",
        "DB_PASSWORD": "your-password",
        "DB_ENCRYPT": "true",
        "DB_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

Cursor/Windsurf/VS Code (.vscode/mcp.json):

{
  "servers": {
    "mssql": {
      "command": "npx",
      "args": ["-y", "mssql-mcp@latest"],
      "env": {
        "DB_SERVER": "your-server.com",
        "DB_DATABASE": "your-database",
        "DB_USER": "your-username",
        "DB_PASSWORD": "your-password",
        "DB_ENCRYPT": "true",
        "DB_TRUST_SERVER_CERTIFICATE": "true"
      }
    }
  }
}

HTTP transport (remote/hosted scenarios):

{
  "servers": {
    "mssql": {
      "type": "http",
      "url": "http://127.0.0.1:3001",
      "env": {}
    }
  }
}

Replace with your actual database credentials. Credentials are read from the server environment only โ€” never passed as tool parameters.

๏ฟฝ๏ฟฝ๏ธ Tool Catalog

Primary tools (use these)

Tool

Read-only

Description

mssql_connect_database

No

Connect using env variables. Idempotent.

mssql_disconnect_database

No

Close connection. Idempotent.

mssql_connection_status

โœ…

Connection state and pool metrics

mssql_run_sql_query

โš ๏ธ No

Execute arbitrary SQL. May mutate data.

mssql_list_schema_objects

โœ…

List tables/views/procedures/functions with pagination

mssql_describe_table_columns

โœ…

Column definitions for a table

mssql_read_table_rows

โœ…

Paginated rows with projection and safe WHERE

mssql_execute_stored_procedure

โš ๏ธ No

Execute a stored procedure

mssql_list_databases

โœ…

List all databases on the instance

All data tools accept a response_format parameter ("json" | "markdown", default "json"). Use "markdown" to get human-readable table output.

Deprecated aliases (still work for backward compatibility)

Old name

Use instead

connect_database

mssql_connect_database

disconnect_database

mssql_disconnect_database

connection_status

mssql_connection_status

execute_query

mssql_run_sql_query

run_sql_query

mssql_run_sql_query

get_schema

mssql_list_schema_objects

list_schema_objects

mssql_list_schema_objects

describe_table

mssql_describe_table_columns

describe_table_columns

mssql_describe_table_columns

get_table_data

mssql_read_table_rows

read_table_rows

mssql_read_table_rows

execute_procedure

mssql_execute_stored_procedure

execute_stored_procedure

mssql_execute_stored_procedure

list_databases

mssql_list_databases

๐ŸšŒ Transport Modes

Mode

Use when

stdio (default)

Local IDE integration (Claude Desktop, Cursor, VS Code)

http

Remote/hosted deployment, testing with MCP Inspector

# stdio (default)
node dist/src/index.js

# HTTP on 127.0.0.1:3001
MCP_TRANSPORT=http node dist/src/index.js

# Custom HTTP host/port
MCP_TRANSPORT=http MCP_HOST=0.0.0.0 MCP_PORT=8080 node dist/src/index.js

๐Ÿ”ง Environment Variables

Database connection

Variable

Required

Default

Description

DB_SERVER

โœ…

โ€”

SQL Server hostname or IP

DB_DATABASE

โŒ

โ€”

Database name

DB_USER

โŒ

โ€”

Login username

DB_PASSWORD

โŒ

โ€”

Login password

DB_PORT

โŒ

1433

TCP port

DB_ENCRYPT

โŒ

true

Enable TLS (required for Azure SQL)

DB_TRUST_SERVER_CERTIFICATE

โŒ

false

Trust self-signed certs

DB_CONNECTION_TIMEOUT

โŒ

30000

Connection timeout ms

DB_REQUEST_TIMEOUT

โŒ

30000

Query timeout ms

Transport

Variable

Default

Description

MCP_TRANSPORT

stdio

stdio or http

MCP_HOST

127.0.0.1

HTTP bind address

MCP_PORT

3001

HTTP port

๐Ÿ”’ Security Model

  • No credential parameters: All connection settings come from environment variables only. Tool inputs cannot override connection config.

  • Identifier validation: Schema, table, and procedure names are validated against a safe identifier pattern before interpolation into SQL.

  • Parameterized queries: All user-supplied values (WHERE clause values, column values) must be passed as named parameters via @paramName โ€” never embedded in query strings.

  • Origin validation: HTTP transport validates Origin header and only allows localhost by default.

  • SQL risk labeling: run_sql_query and execute_stored_procedure are explicitly labeled as non-read-only and open-world.

โš ๏ธ SQL Risk Notes

run_sql_query accepts arbitrary SQL including DDL and DML. To minimize risk:

  • Use a least-privilege SQL login (SELECT-only where possible)

  • Never run the server with a sysadmin or sa account

  • Consider network firewall rules to limit what the server can reach

๐Ÿ“„ Pagination

All list tools return a pagination object:

{
  "count": 20,
  "limit": 20,
  "offset": 0,
  "has_more": true,
  "next_offset": 20,
  "total_count": 150
}

Default page size: 20 rows. Maximum: 200 rows.

Results are also truncated if the serialized payload exceeds 100KB, with a truncation_message explaining how many rows were dropped.

๐Ÿ—๏ธ Architecture

src/
  index.ts          โ† bootstrap (env, transport selection)
  server.ts         โ† createServer() factory
  constants.ts      โ† limits, defaults, protocol strings
  config.ts         โ† env parsing
  types.ts          โ† shared TypeScript interfaces
  db/
    connection.ts   โ† connection pool singleton
    validators.ts   โ† SQL identifier validation
    query-builders.ts โ† safe parameterized query construction
  tools/            โ† one file per tool group
  resources/        โ† MCP resource handlers
  transports/       โ† stdio and HTTP transports
  utils/
    errors.ts       โ† error normalization helpers
    format.ts       โ† JSON formatting, payload truncation
    markdown.ts     โ† markdown table/list rendering helpers
    pagination.ts   โ† pagination metadata helpers

๐Ÿงช Inspector Smoke Test

npx @modelcontextprotocol/inspector

Expected:

  • stdio server connects

  • Tool list renders with all tools

  • mssql_connection_status returns JSON without a connection

  • mssql_connect_database works when env variables are set

๐Ÿ”จ Development

npm install
npm run typecheck   # type check only
npm run build       # compile TypeScript
npm test            # run unit tests
npm run ci          # typecheck + build + test

License

MIT ยฉ BYMCS

Available Tools

14 tools
mssql_connect_databaseConnect DatabaseA
Idempotent

Connects to MS SQL Server using environment variables (DB_SERVER, DB_DATABASE, DB_USER, DB_PASSWORD, DB_PORT, DB_ENCRYPT, DB_TRUST_SERVER_CERTIFICATE). No credentials accepted as parameters โ€” all connection settings come from the server environment only. Idempotent: calling again reconnects.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
configYes
connectedYes
pool_infoYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description reveals that all connection settings come from environment variables only, and that calling again reconnectsโ€”beyond the idempotentHint annotation. It also discloses parameter exclusion, but doesn't cover failure behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the action and resource, then concise details on env vars and idempotency. No redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter connection tool with an output schema and idempotentHint annotation, the description covers connection mechanism, configuration source, and repeated-call behavior. Complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters and 100% schema coverage (empty schema), the description compensates by listing the exact environment variables used and explicitly stating no credentials are accepted, giving full meaning to the empty parameter list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description starts with specific verb 'Connects to MS SQL Server', clearly identifies the resource and distinguishes from disconnect/status/query siblings. It also specifies that no credentials are accepted as parameters, further clarifying scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage as a prerequisite for MSSQL operations, but no explicit 'use when' or 'use connection_status instead' guidance. The description doesn't mention alternatives or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_connection_statusConnection StatusA
Read-onlyIdempotent

Returns the current connection status, server address, database name, and connection pool metrics. Read-only. Safe to call at any time.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
configYes
connectedYes
pool_infoYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds value by noting it is 'safe to call at any time' and specifying the return content (server address, database name, pool metrics), which are not fully covered by annotations alone. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one main sentence plus two short clarifiers. It front-loads the action ('Returns') and conveys all necessary information without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter status tool with a provided output schema, the description sufficiently covers what the tool returns and its safety. Annotations and output schema handle the rest, making it complete for the agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so there is nothing to describe. The baseline for 0-parameter tools is 4, and the description correctly omits parameter discussion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns the current connection status, server address, database name, and connection pool metrics. This uses specific verbs and resources, and is distinct from sibling tools that handle connections, queries, or schema operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by saying it is read-only and safe to call at any time, implying it can be used as a diagnostic check without side effects. It does not explicitly discuss alternatives, but the tool's unique purpose among siblings makes when-to-use obvious.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_describe_tableDescribe Table (deprecated โ€” use mssql_describe_table_columns)A
Read-onlyIdempotent

Deprecated alias for mssql_describe_table_columns.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameYes
schemaNameNodbo
response_formatNojson

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds deprecation status and alias behavior, which is important contextual information beyond annotations. It does not detail return behavior, but for a deprecated read-only alias, this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the deprecation warning and immediately naming the replacement tool. No filler or redundant detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deprecated alias, the description is functionally complete: it tells the agent not to use this tool and directs to the canonical sibling. It omits return-value details, but this is acceptable given the deprecation redirect and the presence of mssql_describe_table_columns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description contains no parameter information. The meaning of tableName, schemaName, and response_format must be inferred solely from parameter names and schema defaults; the description adds no value for parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states 'Deprecated alias for mssql_describe_table_columns,' which clearly identifies the tool as a deprecated redirect and distinguishes it from siblings by naming the canonical tool. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs agents to use mssql_describe_table_columns instead, providing a clear alternative and discouraging use of this deprecated tool. This is strong usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_describe_table_columnsDescribe Table ColumnsA
Read-onlyIdempotent

Returns column definitions for a table: name, data type, length, nullability, default, and ordinal position. Read-only. Uses parameterized queries to prevent injection.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableNameYesTable name
schemaNameNoSchema name (default: dbo)dbo
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablejson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is known. The description adds value by stating 'Read-only' and highlighting the use of parameterized queries to prevent injection, which is useful security context beyond the raw annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences deliver the purpose, returned fields, read-only nature, and security note without any redundancy or filler. All elements are purposeful and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity, the existing annotations, and a full schema with parameter descriptions, the description covers essential return content (column fields) and safety traits. It does not discuss error cases or response formatting nuances, but the response_format parameter is already described in the schema, so this is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema descriptions cover all three parameters with 100% coverage, so the schema already provides parameter meaning. The description adds no parameter-specific details beyond identifying the table as the subject, which is the baseline expectation for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description begins with a specific verb ('Returns') and precisely identifies the resource ('column definitions for a table'). It enumerates the returned fields (name, data type, length, nullability, default, ordinal position), distinguishing this from sibling tools like mssql_describe_table and mssql_get_schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use itโ€”when column-level metadata is neededโ€”but it does not explicitly state when not to use it or mention alternative sibling tools. No exclusions or alternative-tool references are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_disconnect_databaseDisconnect DatabaseA
Idempotent

Closes the current database connection and releases the connection pool. Safe to call even if not connected. Idempotent.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
messageYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

While annotations already declare idempotentHint=true and readOnlyHint=false, the description adds valuable context by stating that the connection pool is released and that calling it when not connected is safe, providing behavioral guarantees beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally concise: two short sentences convey the action, the resource affected, and the safety guarantee, with every phrase earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-parameter, idempotent disconnect tool, the description fully covers behavior, safety, and side effects. The output schema handles return values, and no further context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema coverage, the description has no parameter details to add, and the baseline of 4 for zero-parameter tools applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Closes') and explicitly names the resources affected ('current database connection', 'connection pool'), making it clearly distinguishable from sibling tools like mssql_connect_database and mssql_connection_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (when you want to end the connection) and includes safety guidance ('Safe to call even if not connected'), but does not explicitly mention alternatives or exclusions, which would improve differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_execute_procedureExecute Procedure (deprecated โ€” use mssql_execute_stored_procedure)A

Deprecated alias for mssql_execute_stored_procedure.

ParametersJSON Schema
NameRequiredDescriptionDefault
parametersNo
schemaNameNodbo
procedureNameYesName of the stored procedure
response_formatNojson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds the deprecation status and alias relationship, which is not present in annotations. It discloses that this tool should be avoided and behaves identically to the replacement, though it doesn't elaborate on execution semantics. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately conveys deprecation and the replacement. No wasted words; perfectly sized for a deprecated alias.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

As a deprecated tool, the essential context (deprecation, replacement) is fully provided. It lacks operational details, but that is acceptable given the strong recommendation to use another tool. The presence of 4 params and no output schema doesn't necessitate more here.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 25% (only procedureName has a description). The tool description adds no parameter details, failing to compensate for the low coverage. Parameters like response_format and parameters remain unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies the tool as a deprecated alias for mssql_execute_stored_procedure, which indicates its function (executing stored procedures) through the sibling's name. It clearly distinguishes from siblings by pointing to the canonical replacement, though it doesn't state the action directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'deprecated' and names the alternative mssql_execute_stored_procedure, providing clear when-not-to-use guidance and pointing to the correct replacement tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_execute_queryExecute Query (deprecated โ€” use mssql_run_sql_query)A

Deprecated alias for mssql_run_sql_query. Use mssql_run_sql_query instead. โš ๏ธ This tool can read AND modify data.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute
parametersNoQuery parameters
response_formatNojson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds a warning that the tool can read and modify data, complementing the readOnlyHint=false annotation. It also discloses the deprecated status, which is not present in annotations. However, it does not detail other behavioral aspects like authentication or side effects, though the deprecation reduces the need.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences plus a warning icon, front-loaded with deprecation and the alternative. Every word earns its place, and the structure is immediately scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deprecated tool, the description provides essential guidance: what it is, what to use instead, and a safety warning. It lacks details about return values or specific usage scenarios, but these are less critical given the deprecation and the explicit pointer to the replacement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not discuss parameters. The input schema documents 'query' and 'parameters', but 'response_format' only has an enum without a description. With 67% schema coverage, the description adds no additional semantic value, leaving some parameter meaning unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as a deprecated alias for mssql_run_sql_query, making its function apparent through reference. The title reinforces 'Execute Query'. It distinguishes from siblings by pointing to the preferred alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to use mssql_run_sql_query instead, providing clear when-not-to-use guidance. This is exactly the kind of direct alternative direction that helps an agent decide correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_execute_stored_procedureExecute Stored ProcedureA

Executes a stored procedure by name. โš ๏ธ May modify data โ€” use only when an action is intended. Schema and procedure names are validated as safe identifiers. Pass all value parameters via 'parameters'.

ParametersJSON Schema
NameRequiredDescriptionDefault
parametersNoProcedure input parameters (key-value pairs)
schemaNameNoSchema name (default: dbo)dbo
procedureNameYesStored procedure name
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablesjson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond annotations, including the warning about data modification and the note that schema/procedure names are validated as safe identifiers. This enhances safety awareness even though annotations already indicate mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded with the main action. The warning and validation note are delivered in just two sentences without any waste, making it easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich schema descriptions and annotations, the description covers the essential purpose, safety warning, and identifier validation. It does not detail return values, but the response_format parameter in the schema covers output options, making the description adequately complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description only adds 'Pass all value parameters via parameters', which is redundant but confirms usage. It does not add significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a stored procedure by name, which is a specific verb+resource. However, it does not explicitly differentiate from the similarly named sibling tool 'mssql_execute_procedure', which could cause confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context with the warning 'use only when an action is intended', implying it is not for read-only operations. It does not name alternative tools, but the guidance is sufficient for most cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_schemaGet Schema (deprecated โ€” use mssql_list_schema_objects)A
Read-onlyIdempotent

Deprecated alias for mssql_list_schema_objects. Use mssql_list_schema_objects instead.

ParametersJSON Schema
NameRequiredDescriptionDefault
objectTypeNotables
schemaNameNo
response_formatNojson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only and idempotent behavior. The description adds the critical deprecation status and aliasing context, which is valuable behavioral/maintenance info beyond what annotations provide. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the deprecation notice and immediate alternative. Every word earns its place; no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deprecated alias, the description is complete: it states the deprecation and points to the replacement. It doesn't elaborate on behavior or return format, but as an alias, those details are inherited from the target tool. Given the annotations and simplicity, this is adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate for parameter meaning but does not. The schema provides enums and defaults, but the meaning of parameters like schemaName is left entirely to the agent's inference. Minimal help.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states this is a deprecated alias for mssql_list_schema_objects, which conveys the tool's function (listing schema objects) and distinguishes it from siblings by explicitly naming the replacement. The purpose is implicit but unambiguous given the title and description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs to use mssql_list_schema_objects instead, providing a clear when-not-to-use directive and naming the alternative. This is the strongest possible usage guidance for a deprecated tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_get_table_dataGet Table Data (deprecated โ€” use mssql_read_table_rows)A
Read-onlyIdempotent

Deprecated alias for mssql_read_table_rows. Use mssql_read_table_rows instead. โš ๏ธ whereClause must use @paramName placeholders for all values.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
orderByNo
tableNameYes
parametersNo
schemaNameNodbo
whereClauseNo
response_formatNojson

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and idempotentHint, so the description's deprecation notice and the @paramName placeholder requirement add valuable behavioral context beyond the structured data. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: two sentences that front-load the deprecation status and directive to use the alternative. The warning is included without excess words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a deprecated tool, the description fully serves the primary purpose of redirecting agents to the proper tool. However, since there is no output schema and no info about return format or the remaining parameters, it is not sufficient for direct invocation if someone bypasses the deprecation warning.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only explains the whereClause placeholder requirement, leaving the other 7 parameters (limit, offset, orderBy, tableName, parameters, schemaName, response_format) without any additional meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states this is a deprecated alias for mssql_read_table_rows, and the title 'Get Table Data' implies its function. It distinguishes itself from siblings by explicitly naming the replacement tool, though it doesn't elaborate on what the underlying operation does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs to use mssql_read_table_rows instead, providing unambiguous when-to-use guidance. It also adds a critical usage warning about whereClause requiring @paramName placeholders, which is directly actionable for correct invocation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_list_databasesList DatabasesA
Read-onlyIdempotent

Lists all databases visible on the connected SQL Server instance with state and recovery information. Read-only. Supports pagination.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax databases (default 20)
offsetNoSkip N databases
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablejson

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, and the description adds value by mentioning the connected instance scope, pagination behavior, and that it returns state and recovery information. It doesn't disclose additional caveats like whether an active connection is required, but the connected instance phrase implies a prerequisite.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the primary purpose, and every phrase ('Read-only', 'Supports pagination') adds relevant information without redundancy. It is well-structured and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, annotations, and complete parameter schema, the description is largely sufficient. It mentions the return content (state and recovery info) and pagination, though without an output schema it could be slightly more explicit about the overall return shape or permission requirements. Still, it covers the essentials for a straightforward read-only listing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides full descriptions for all three parameters (limit, offset, response_format) with 100% coverage. The description only adds 'Supports pagination,' which is already evident from the limit/offset schema, so it does not meaningfully enhance parameter understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Lists all databases'), resource ('databases'), and scope ('on the connected SQL Server instance'), while also specifying the content ('with state and recovery information'). This distinguishes it from sibling tools like mssql_list_schema_objects or mssql_get_schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: after connecting to a SQL Server instance, when you need a list of databases with state and recovery info. It includes 'Read-only' and 'Supports pagination' which guide usage, though it doesn't explicitly name alternatives or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_list_schema_objectsList Schema ObjectsA
Read-onlyIdempotent

Lists tables, views, stored procedures, or functions in the connected database. Read-only. Supports filtering by schema name and pagination. Example: objectType='tables', schemaName='dbo', limit=20

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax objects (default 20)
offsetNoSkip N objects
objectTypeNoType of objects to list (default: tables)tables
schemaNameNoFilter to a specific schema (e.g. 'dbo')
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablejson

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description's 'Read-only' is redundant. The description adds filtering and pagination behavior, but this is largely a restatement of input schema capabilities. It does not disclose edge cases, connection requirements, or output structure beyond the schema. This is adequate but not exceptional.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences plus an example, front-loaded with the core purpose. Every sentence adds value: the first states what it lists, the second notes read-only and filtering/pagination, and the example shows syntax. No filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a listing tool with no output schema, the description covers the essential aspects: what it lists, read-only nature, filtering, pagination, and an example. It assumes the database is already connected, which is implied by 'in the connected database.' It doesn't mention response_format, but that is documented in the schema. Overall, it is complete enough for an AI to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents all parameters. The description adds a concrete example ('objectType='tables', schemaName='dbo', limit=20') which illustrates usage but doesn't provide new semantic meaning beyond the schema. The baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the tool's purpose: 'Lists tables, views, stored procedures, or functions in the connected database.' This uses a specific verb (lists) and resource (schema objects), and distinguishes from siblings like mssql_get_table_data or mssql_get_schema. The inclusion of an example further clarifies the intent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool: it operates on the connected database, is read-only, and supports filtering and pagination. While it doesn't explicitly name alternatives or exclusions, the 'read-only' and 'connected database' hints give usage context. The example demonstrates a typical invocation, but it lacks explicit comparison to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_read_table_rowsRead Table RowsA
Read-onlyIdempotent

Returns rows from a table with optional column projection, WHERE filtering, ORDER BY, and pagination. Read-only. Table and schema names are validated as safe identifiers. WHERE clause values MUST be passed via 'parameters' using @paramName placeholders. Pagination: limit (1-200, default 20) and offset. Example: tableName='Orders', schemaName='dbo', columns=['OrderId','Total'], limit=50

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows (1-200)
offsetNoRows to skip
columnsNoColumns to return (default: all)
orderByNoORDER BY expression. Example: 'CreatedAt DESC, Id ASC'
tableNameYesTable name
parametersNoValues for WHERE clause @paramName placeholders
schemaNameNoSchema name (default: dbo)dbo
whereClauseNoWHERE predicate without WHERE keyword. Use @paramName for all values. Example: 'Status = @status AND Amount > @minAmount'
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablejson

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (readOnlyHint, idempotentHint), the description adds critical behavioral details: table/schema names are validated as safe identifiers and WHERE clause values MUST be passed via parameters. It also specifies pagination limits. This significantly enhances the agent's understanding and safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core action, followed by safety requirements and a practical example. Every sentence contributes meaningful information with no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 9 parameters and no output schema, the description covers the essential operational aspects: read-only nature, identifier validation, parameterization, pagination, and an example. It doesn't explain response_format or return structure, but the schema covers those; it's sufficient for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds value by explaining the relationship between whereClause and parameters via '@paramName' placeholders and provides a concrete example using tableName, schemaName, columns, and limit. This clarifies usage beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns rows from a table with optional projection, filtering, ordering, and pagination, which is a specific verb+resource. However, it does not explicitly differentiate itself from sibling tools like mssql_get_table_data or mssql_run_sql_query, so it falls short of the full 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it's a read-only operation, requires parameterized WHERE values, and explains pagination behavior. It does not explicitly state when not to use it or mention alternative tools, so it lacks exclusions but still gives solid usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mssql_run_sql_queryRun SQL QueryA

Executes an arbitrary SQL statement against the connected database. โš ๏ธ WARNING: This tool can read AND modify data (INSERT, UPDATE, DELETE, DDL). Always prefer parameterized inputs via the 'parameters' field โ€” never embed user-supplied values directly in the query string. Example: query='SELECT * FROM dbo.Users WHERE Id = @id', parameters={id: 42}

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL statement to execute
parametersNoNamed parameters referenced in the query via @paramName
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable tablejson

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=false, openWorldHint=true, and idempotentHint=false. The description adds meaningful behavioral context by explicitly warning that the tool can read AND modify data, listing INSERT, UPDATE, DELETE, and DDL as examples, and urging parameterized inputs to prevent injection. This goes beyond the annotation metadata.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized, front-loaded with the core purpose, and every sentence earns its place. The warning and example are directly useful, and there is no redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's arbitrary SQL execution nature and the absence of an output schema, the description covers the most critical aspects: it warns about data modification and demonstrates safe parameter usage. It does not describe return formats or error behavior in detail, but the response_format parameter partially addresses output expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% coverage for all parameters, so the baseline is 3. The description adds value by including a concrete example showing the '@paramName' syntax and emphasizing the security rationale for using the 'parameters' field, which goes beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool executes an arbitrary SQL statement against the connected database, which is a specific verb+resource pairing. It is clear but does not explicitly differentiate itself from sibling tools like mssql_execute_query, so it does not fully achieve the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides strong security guidance about parameterized inputs and avoiding SQL injection, but it does not explicitly state when to use this tool versus alternatives such as mssql_get_table_data or mssql_execute_stored_procedure. Usage context is implied by 'arbitrary SQL' rather than explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.8/5.0
Disambiguation3/5

Several tools are duplicates with different names (e.g., mssql_get_table_data vs mssql_read_table_rows, mssql_execute_query vs mssql_run_sql_query). Descriptions clearly mark deprecated aliases, reducing confusion, but the presence of both still creates ambiguity about which to use.

Naming Consistency2/5

Tool names follow a mssql_ prefix but use inconsistent verb patterns: connect/disconnect, get/run/execute/list/describe/read. The deprecated aliases introduce further inconsistency (e.g., get_table_data vs read_table_rows, execute_procedure vs execute_stored_procedure). No uniform verb_noun convention.

Tool Count4/5

14 tools is within the acceptable range, but 5 are deprecated aliases, inflating the count and adding redundancy. The unique tool set is about 9, which is well-scoped. Slightly heavier than needed but not excessive.

Completeness4/5

The server covers core SQL Server operations: connection management, arbitrary query execution, table reads, schema listing, column descriptions, stored procedures, and database listing. Arbitrary SQL covers writes, so no major dead ends. Minor gaps include no transaction control or bulk operation tools.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to interact with Microsoft SQL Server databases through query execution, schema discovery, CRUD operations, stored procedures, and data export with built-in safety controls.
    18
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Microsoft SQL Server databases through a standardized interface. Supports executing SQL queries, browsing database schemas, and viewing table data with flexible authentication options for both local and Azure SQL databases.
    5
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides direct SQL query access to Microsoft SQL Server databases with full CRUD operations, enabling AI assistants to execute queries, modify data, and manage database objects through a simplified interface.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to query and manage MSSQL databases using natural language, supporting CRUD operations and schema management.
    3,338
    MIT

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/bymcs/mssql-mcp'

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