A powerful Microsoft SQL Server MCP (Model Context Protocol) server that enables Claude Desktop to interact with SQL Server databases through natural language queries. - ๐ค AI-Ready: Seamless integration with Claude Desktop and MCP protocol - ๐ Smart Queries: Execute SQL queries in CSV or JSON format through natural language - ๐ Secure Authentication: Support for SQL Server Auth, Windows Auth, a
Add this skill
npx mdskills install wenerme/wodeWell-documented MCP server enabling SQL Server database queries through Claude with strong security options
A powerful Microsoft SQL Server MCP (Model Context Protocol) server that enables Claude Desktop to interact with SQL Server databases through natural language queries.
# Run directly without installation
npx @wener/mssql-mcp --help
# Start with environment variables
MSSQL_SERVER=localhost MSSQL_DATABASE=mydb MSSQL_USER=sa MSSQL_PASSWORD=password npx @wener/mssql-mcp --stdio
# Start with environment file
npx @wener/mssql-mcp --env-file .env --stdio
# Install globally
npm install -g @wener/mssql-mcp
# Run from anywhere
mssql-mcp --help
Create a .env file with your database credentials:
# Required: Database connection
MSSQL_SERVER=localhost
MSSQL_DATABASE=AdventureWorks2019
MSSQL_USER=sa
MSSQL_PASSWORD=YourPassword123
# Optional: Security and performance
MSSQL_ACCESS_MODE=readonly # Use 'readonly' for safe querying
MSSQL_ENCRYPT=false # Set 'true' for Azure SQL
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": ["@wener/mssql-mcp", "--env-file", "/path/to/your/.env", "--stdio"]
}
}
}
Your SQL Server database is now available to Claude! ๐
MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database
MSSQL_WINDOWS_AUTH=true
MSSQL_SERVER=yourserver.database.windows.net
MSSQL_DATABASE=your_database
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
# MSSQL_ENCRYPT=true (automatically enabled for Azure SQL)
MSSQL_SERVER=(localdb)\\MSSQLLocalDB
MSSQL_DATABASE=MyLocalDatabase
MSSQL_WINDOWS_AUTH=true
# Port (default: 1433)
MSSQL_PORT=1433
# Force encryption (default: false, auto-enabled for Azure SQL)
MSSQL_ENCRYPT=true
# Access mode: 'readonly' or 'readwrite' (default: readwrite)
MSSQL_ACCESS_MODE=readonly
When connected, Claude can use these capabilities:
exec_sql_csv: Execute SQL queries and get results in CSV formatexec_sql_json: Execute SQL queries and get results in JSON formatget_version: Get SQL Server version information (readOnlyHint: true)For production databases, use read-only mode:
MSSQL_ACCESS_MODE=readonly
This restricts operations to:
SELECT statementsWITH (Common Table Expressions)SHOW, DESCRIBE, EXPLAIN, DESC commands"Show me the top 10 customers by total sales from the database"
"What tables are available in this database?"
"Create a summary report of inventory levels by category"
"Find all orders placed in the last 30 days"
Claude will automatically:
mssql-mcp --stdio --env-file .env
mssql-mcp --port 3003 --host localhost --env-file .env
--stdio: Use STDIO transport (required for Claude Desktop)--env-file : Load environment variables from file--port : HTTP server port (default: 3003)--host : HTTP server host (default: localhost)--verbose: Enable detailed logging--help: Show help information# Test connection
mssql-mcp --verbose --env-file .env
# Check SQL Server is running
sqlcmd -S localhost -U sa -P yourpassword -Q "SELECT @@VERSION"
"Login failed": Check username, password, and database name
"Server not found": Verify MSSQL_SERVER and MSSQL_PORT
"SSL error": Set MSSQL_ENCRYPT=false for local development
"Permission denied": Ensure user has database access permissions
# Enable verbose logging
mssql-mcp --verbose --stdio --env-file .env
Perfect for testing and learning:
MSSQL_SERVER=localhost
MSSQL_DATABASE=AdventureWorks2019
MSSQL_USER=sa
MSSQL_PASSWORD=YourPassword123
MSSQL_ACCESS_MODE=readonly # Safe for exploration
Great for business scenarios:
MSSQL_SERVER=localhost
MSSQL_DATABASE=Northwind
MSSQL_USER=sa
MSSQL_PASSWORD=YourPassword123
MIT License - feel free to use in personal and commercial projects.
Issues and feature requests are welcome on GitHub.
Made with โค๏ธ for the AI and SQL Server community
Install via CLI
npx mdskills install wenerme/wodeWener/mssql MCP is a free, open-source AI agent skill. A powerful Microsoft SQL Server MCP (Model Context Protocol) server that enables Claude Desktop to interact with SQL Server databases through natural language queries. - ๐ค AI-Ready: Seamless integration with Claude Desktop and MCP protocol - ๐ Smart Queries: Execute SQL queries in CSV or JSON format through natural language - ๐ Secure Authentication: Support for SQL Server Auth, Windows Auth, a
Install Wener/mssql MCP with a single command:
npx mdskills install wenerme/wodeThis downloads the skill files into your project and your AI agent picks them up automatically.
Wener/mssql MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.