Microsoft SQL Server MCP Server
The Microsoft SQL Server MCP Server provides a secure interface to interact with SQL Server databases. With this server, you can:
Execute SQL queries against the configured database with proper error handling
List available SQL Server tables through appropriate system queries
Read table contents via SELECT statements
Secure database access through environment variables
Track operations with comprehensive logging
Benefit from automatic installation of required system dependencies
All operations are subject to the database user's permissions.
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., "@Microsoft SQL Server MCP Servershow me the top 10 customers by total purchases"
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.
Microsoft SQL Server MCP Server
A Model Context Protocol (MCP) server for secure SQL Server database access through Claude Desktop.
Features
π List database tables
π Execute SQL queries (SELECT, INSERT, UPDATE, DELETE)
π Multiple authentication methods (SQL, Windows, Azure AD)
π’ LocalDB and Azure SQL support
π Custom port configuration
Related MCP server: SQL Server MCP
Quick Start
Install with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mssql": {
"command": "uvx",
"args": ["microsoft_sql_server_mcp"],
"env": {
"MSSQL_SERVER": "localhost",
"MSSQL_DATABASE": "your_database",
"MSSQL_USER": "your_username",
"MSSQL_PASSWORD": "your_password"
}
}
}
}Configuration
Basic SQL Authentication
MSSQL_SERVER=localhost # Required
MSSQL_DATABASE=your_database # Required
MSSQL_USER=your_username # Required for SQL auth
MSSQL_PASSWORD=your_password # Required for SQL authWindows Authentication
MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database
MSSQL_WINDOWS_AUTH=true # Use Windows credentialsAzure SQL Database
MSSQL_SERVER=your-server.database.windows.net
MSSQL_DATABASE=your_database
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
# Encryption is automatic for AzureOptional Settings
MSSQL_PORT=1433 # Custom port (default: 1433)
MSSQL_ENCRYPT=true # Force encryptionAlternative Installation Methods
Using pip
pip install microsoft_sql_server_mcpThen in claude_desktop_config.json:
{
"mcpServers": {
"mssql": {
"command": "python",
"args": ["-m", "mssql_mcp_server"],
"env": { ... }
}
}
}Development
git clone https://github.com/RichardHan/mssql_mcp_server.git
cd mssql_mcp_server
pip install -e .Security
Create a dedicated SQL user with minimal permissions
Never use admin/sa accounts
Use Windows Authentication when possible
Enable encryption for sensitive data
License
MIT
Available Tools
1 toolexecute_sqlC
Execute an SQL query on the SQL Server
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SQL query to execute |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description fails to disclose whether queries are read-only or can modify data, potential risks like SQL injection, or result formats. This is a significant gap for a tool that can execute arbitrary SQL.
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 very concise at one sentence, but it lacks structure and does not front-load key information beyond the basic action. It could include more detail without becoming verbose.
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?
Given the lack of output schema and annotations, the description is incomplete. It does not explain what the tool returns (e.g., result sets, affected rows), error behavior, or any constraints. Critical context for safe usage is missing.
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?
The input schema has high coverage (100%) and describes the 'query' parameter sufficiently. The description adds no extra meaning beyond what the schema already provides, so a baseline score of 3 is appropriate.
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 verb 'execute' and the resource 'SQL query on the SQL Server', making the purpose straightforward. However, it restates the tool name without adding depth beyond stating it runs queries.
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?
No guidance on when to use this tool or when to avoid it. No mention of prerequisites, security considerations, or alternatives. The description provides no contextual usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
execute_sql
TDQS
Only one tool exists, so there is no risk of confusion or overlap.
With a single tool, naming is trivially consistent to itself.
A single SQL execution tool is insufficient for the typical scope of SQL Server operations, which usually requires multiple tools for schema exploration, query execution, and data manipulation.
The tool set is severely incomplete; it lacks fundamental operations such as listing tables, describing schemas, or managing databases, limiting useful agent 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
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.
The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.58MIT
- AlicenseBqualityCmaintenanceA Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.87228MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.467MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides comprehensive access to Microsoft SQL Server databases, enabling Language Models to inspect schemas, execute queries, manage database objects, and perform advanced database operations.8-
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/RichardHan/mssql_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server