MSSQL MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MSSQL MCP Servershow me the top 10 customers by total sales"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MSSQL MCP Server
A Model Context Protocol (MCP) server for connecting to Microsoft SQL Server databases. This server provides tools for executing SQL queries and managing database connections.
Installation
Installing via Smithery
To install MSSQL Database Connector for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @knight0zh/mssql-mcp-server --client claudeManual Installation
npm install mssql-mcp-serverRelated MCP server: MCP SQL Server
Usage
Add the server to your MCP settings configuration file:
{
"mcpServers": {
"mssql": {
"command": "mssql-mcp-server",
"env": {
"MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;",
// Or individual connection parameters:
"MSSQL_HOST": "localhost",
"MSSQL_PORT": "1433",
"MSSQL_DATABASE": "master",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "yourpassword",
"MSSQL_ENCRYPT": "false",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}Tools
query
Execute a SQL query on a MSSQL database.
Parameters
connectionString(string, optional): Full connection string (alternative to individual parameters)host(string, optional): Database server hostnameport(number, optional): Database server port (default: 1433)database(string, optional): Database name (default: master)username(string, optional): Database usernamepassword(string, optional): Database passwordquery(string, required): SQL query to executeencrypt(boolean, optional): Enable encryption (default: false)trustServerCertificate(boolean, optional): Trust server certificate (default: true)
Either connectionString OR (host + username + password) must be provided.
Example
const result = await use_mcp_tool({
server_name: 'mssql',
tool_name: 'query',
arguments: {
host: 'localhost',
username: 'sa',
password: 'yourpassword',
query: 'SELECT * FROM Users',
},
});Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Run tests
npm test
# Run linter
npm run lint
# Format code
npm run formatLicense
MIT
Available Tools
1 toolqueryC
Execute a SQL query on a MSSQL database
| Name | Required | Description | Default |
|---|---|---|---|
| connectionString | No | Full connection string (alternative to individual parameters) | |
| host | No | Database server hostname | |
| port | No | Database server port (default: 1433) | |
| database | No | Database name (default: master) | |
| username | No | Database username | |
| password | No | Database password | |
| query | Yes | SQL query to execute | |
| encrypt | No | Enable encryption (default: false) | |
| trustServerCertificate | No | Trust server certificate (default: true) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While 'Execute a SQL query' implies both read and write operations, it doesn't specify permissions needed, potential side effects, rate limits, or what happens with complex queries. For a database tool with zero annotation coverage, this leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded with the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a database query tool with 9 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what types of queries are supported, what the return format looks like, error handling, or security considerations. The tool has significant complexity that isn't addressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline for high schema coverage but doesn't provide additional value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Execute a SQL query') and target resource ('on a MSSQL database'), providing specific verb+resource information. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or context for usage. It simply states what the tool does without any usage instructions or constraints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools, as there are no other tools to compare it to. The tool's purpose is clearly defined and distinct by default.
Since there is only one tool, it inherently has perfect naming consistency with itself. The tool name 'query' follows a simple verb pattern, and there are no other tools to create inconsistency.
A single tool for an MSSQL server is too few for the apparent scope, as it lacks basic operations like listing tables, describing schemas, or executing parameterized queries. This minimal set will likely cause agent failures due to incomplete functionality.
The tool surface is severely incomplete for an MSSQL database server. While the 'query' tool allows executing SQL, there are significant gaps such as no tools for metadata exploration, transaction management, or data manipulation beyond raw queries, which are essential for typical database workflows.
Maintenance
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
Model Context Protocol server for Studex tools, notifications, and profile integrations
A Model Context Protocol server for Wix AI tools
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables execution of SQL queries and management of Microsoft SQL Server database connections through the Model Context Protocol.333,33815MIT
- FlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
- FlicenseCqualityDmaintenanceA Model Context Protocol server that provides a standardized interface for interacting with SQL databases through the MCP protocol.3204
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server for interacting with MSSQL and PostgreSQL databases, offering tools for schema exploration and SQL execution. It features configurable query modes for safety and supports advanced authentication methods like Windows Auth and SSL.17MIT
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/knight0zh/mssql-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server