This guide provides detailed instructions for deploying the SQL Server MCP (Model Context Protocol) Server using Docker.
This image is pushed to Docker Hub as mcprunner/mssqlmcp
Recommend using persistent storage for Data directory and secure method of replacing Variable values.
# MINGW64 Bash on Windows
MSYS_NO_PATHCONV=1 docker run -d \
--name mssqlmcp \
-p 3001:3001 \
-e MSSQL_MCP_KEY="StrongEncryptionKeyForEncryptionOfYourConnectionStrings" \
-e MSSQL_MCP_API_KEY="StrongApiKeyYourConnections" \
-v "$(pwd)/data:/app/Data" \
-v "$(pwd)/logs:/app/Logs" \
mcprunner/mssqlmcp:latest;
Starting with standard bash is almost identical
# Standard Bash
docker run -d \
--name mssqlmcp \
-p 3001:3001 \
-e MSSQL_MCP_KEY="StrongEncryptionKeyForEncryptionOfYourConnectionStrings" \
-e MSSQL_MCP_API_KEY="StrongApiKeyYourConnections" \
-v "$(pwd)/data:/app/Data" \
-v "$(pwd)/logs:/app/Logs" \
mcprunner/mssqlmcp:latest;
Update or create your .vscode/mcp.json file.
{
"inputs": [
{
"id": "mssql-server-mcp-api-key",
"type": "promptString",
"description": "Enter your SQL Server MCP API Key",
"password": true
}
],
"servers": {
"sql-server-mcp": {
"url": "http://localhost:3001",
"headers": {
"X-API-Key": "${input:mssql-server-mcp-api-key}",
"Content-Type": "application/json"
}
}
}
}
Once added you should be able to hover over the "sql-server-mcp" and see "Start". Select Start and enter in the same API Key you started the docker image with.
https://github.com/MCPRUNNER/mssqlMCP
If you encounter issues:
Check the container logs:
docker logs mssqlmcp;
Verify environment variables are set correctly:
docker inspect mssqlmcp | grep -A 10 "Env";
Ensure volume mounts have appropriate permissions:
ls -la ./data ./logs;
For more details on using the SQL Server MCP Server, refer to the main README.md and QUICK_INSTALL.md files in https://github.com/MCPRUNNER/mssqlMCP.
Content type
Image
Digest
sha256:18310ea10…
Size
119.9 MB
Last updated
10 months ago
docker pull mcprunner/mssqlmcp