- MCP MSSQL Server
MCP MSSQL Server
Content
MCP MSSQL Server
An MCP (Model Context Protocol) server for Microsoft SQL Server integration built with NestJS. This server enables Claude Code and other MCP clients to interact with SQL Server databases through standardized tools.
Features
- MCP Protocol Support: Full implementation of Model Context Protocol for SQL Server operations
- Windows Authentication: Supports both Windows (NTLM) and SQL Server authentication
- Comprehensive SQL Tools: Execute queries, explore schema, manage tables, and run stored procedures
- Health Monitoring: Built-in health checks for database connectivity
- Connection Pooling: Efficient database connection management
MCP Tools
The server exposes these SQL operations as MCP tools:
execute-query: Execute SQL queries with parameter supportget-schema: Retrieve database schema informationlist-tables: List all tables in the databasedescribe-table: Get detailed table structure with constraintsget-table-data: Retrieve paginated table data with filteringexecute-procedure: Execute stored procedures with parameters
Installation
npm install
Configuration
Create a .env file with your database configuration:
# SQL Server Connection
MSSQL_HOST=localhost
MSSQL_PORT=1433
MSSQL_DATABASE=your_database
# Authentication Mode (choose one)
# For SQL Server Authentication:
MSSQL_USERNAME=your_username
MSSQL_PASSWORD=your_password
# For Windows Authentication:
MSSQL_WIN_AUTH=true
MSSQL_DOMAIN=your_domain
MSSQL_USERNAME=domain\username
MSSQL_PASSWORD=your_password
# Connection Options
MSSQL_ENCRYPT=true
MSSQL_TRUST_CERT=true
# Server Port
PORT=3000
Development
# Start in development mode
npm run start:dev
# Start with debugging
npm run start:debug
# Build the application
npm run build
# Start production build
npm run start:prod
Testing
# Unit tests
npm run test
# Watch mode
npm run test:watch
# End-to-end tests
npm run test:e2e
# Test coverage
npm run test:cov
Code Quality
# Run ESLint with auto-fix
npm run lint
# Format code with Prettier
npm run format
MCP Endpoints
When the server is running (default port 3000):
- MCP Protocol:
http://localhost:3000/mssql/mcp - SSE (Claude Code):
http://localhost:3000/mssql/sse - Health Check:
http://localhost:3000/mssql/health
Usage with Claude Code
- Start the MCP server:
npm run start:dev - Configure Claude Code to connect to:
http://localhost:3000/mssql/mcp - Use the exposed SQL tools through Claude Code's MCP interface
Architecture
- MCPModule: Handles MCP protocol implementation with
/mssqlnamespace - DatabaseModule: Manages SQL Server connectivity and authentication
- HealthModule: Provides database health monitoring
- No REST endpoints: All functionality exposed through MCP tools only
License
ISC
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop