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
npm install mssql-mcp-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 format
License
MIT
MSSQL MCP Server
Project Details
- c0h1b4/mssql-mcp-server
- MIT License
- Last Updated: 4/17/2025
Categories
Recomended MCP Servers
NEXUS MCP- Simple MCP server for Claude Desktop
A Model Context Protocol (MCP) server for Apache Seatunnel. This provides access to your Apache Seatunnel RESTful API...
Local MCP server implementation for Starwind UI that you can use with Cursor, Windsurf, and other AI tools
FastAPI server implementing MCP protocol Browser automation via browser-use library.
A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and...
A collection of tools for your LLMs that run on Modal
基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server
【Every star you give feeds a hungry developer's motivation!】A Model Context Protocol (MCP) server implementation that provides Google...
Analyze user input to identify suitable design patterns and project templates. Orchestrate the project, creating initial files from...
A lightweight MCP server for generating placeholder images from multiple providers.
All-in-one infrastructure for search, recommendations, RAG, and analytics offered via API