@yashpatel28/sqlserver-mcp
v1.0.4
Published
Universal SQL Server MCP Server
Maintainers
Readme
@sqlmcp/sqlserver-mcp
Universal SQL Server MCP server launched through npx. It bundles the Python MCP application and creates a per-user Python virtual environment on first launch.
Requirements: Windows 10/11, Node.js/npm, and Python 3.12. The first launch installs the pinned Python requirements into the user cache, so it needs access to the Python package index.
Example OpenCode configuration:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"sql-server": {
"type": "local",
"command": ["npx", "-y", "@sqlmcp/sqlserver-mcp"],
"environment": {
"SQL_MCP_SERVER": "your-sql-server",
"SQL_MCP_DATABASE": "your-database"
}
}
}
}
}Windows Authentication is used by default. For SQL Server Authentication, also set SQL_MCP_AUTHENTICATION to sql, SQL_MCP_USERNAME, and SQL_MCP_PASSWORD. In OpenCode config, pass a password from an existing environment variable as "SQL_MCP_PASSWORD": "{env:SQL_MCP_PASSWORD}", or store it in a local .env under %LOCALAPPDATA%\UniversalSqlMCP. Never commit a password.
The application stores connections.json, .env, approval state, and rotating logs under %LOCALAPPDATA%\UniversalSqlMCP. SQL_MCP_HOME can override this directory.
The server runs in read-only mode. Query tools accept only plain read-only SELECT statements. Data changes, SQL preparation/execution, and connection configuration changes are rejected by the server regardless of OpenCode permissions. For added protection, configure the SQL Server login with read-only database permissions.
