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., "@MCP SQL Servershow me the schema for the Users table and its indexes"
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.
MCP SQL Server
A Model Context Protocol (MCP) server for SQL Server integration with Claude Code. Query, monitor, and analyze your SQL Server databases directly from Claude.
Features
Query Execution - Execute SELECT queries with parameterized inputs
Schema Exploration - Browse tables, columns, procedures, and indexes
Database Monitoring - Track active queries, blocking sessions, wait stats, and connections
Performance Analysis - Identify missing indexes, unused indexes, and fragmentation
Write Operations - INSERT, UPDATE, DELETE when enabled (READONLY=false)
Installation
Option 1: From npm (recommended)
Option 2: Global installation
Option 3: Clone and build locally
Configuration
Claude Code Integration
Add to your Claude Code MCP settings (~/.claude/settings.json or project .claude/settings.json):
Or with individual connection parameters:
Environment Variables
Connection (choose one method)
Method 1: Connection URL
Method 2: Individual Parameters
Required Settings
Variable | Description |
| Required. Set to |
Optional Settings
Variable | Default | Description |
|
| Query timeout in milliseconds (max: 120000) |
|
| Maximum rows to return (max: 5000) |
|
| Minimum connection pool size |
|
| Maximum connection pool size |
|
| Log level: debug, info, warn, error |
Available Tools
Query Tools
Tool | Description |
| Execute SELECT queries with parameterized inputs |
Schema Tools
Tool | Description |
| List all tables and views in the database |
| Get detailed table information (columns, indexes, foreign keys) |
| Search for columns across all tables |
| List stored procedures |
| List indexes with usage statistics |
Monitor Tools
Tool | Description |
| Monitor currently running queries |
| Monitor blocking sessions and lock chains |
| Monitor wait statistics for performance bottlenecks |
| Monitor database size and file usage |
| Monitor active connections |
| Monitor SQL Server performance counters |
Analysis Tools
Tool | Description |
| Analyze query execution plan and statistics |
| Suggest missing indexes based on query patterns |
| Find indexes that are not being used |
| Find duplicate or overlapping indexes |
| Analyze index fragmentation levels |
| Analyze table statistics for stale data |
Write Tools (READONLY=false only)
Tool | Description |
| Insert a row into a table |
| Update rows in a table |
| Delete rows from a table |
Usage Examples
Once configured, you can ask Claude to interact with your database:
Security Considerations
Always use READONLY=true in production unless write access is explicitly required
Store credentials securely using environment variables
Use SQL Server accounts with minimal required permissions
Consider network security (VPN, firewall rules) for remote connections
Requirements
Node.js >= 20.0.0
SQL Server 2016 or later
Appropriate SQL Server permissions for the operations you want to perform
Development
License
MIT License - see LICENSE file for details.