Run governed SQL queries and inspect database schemas from MCP agents.
registry version 0.6.28
npm
npx -y sql-previewnpm
npx -y sql-preview@0.6.28
Pick your client — the config below is generated for this server (local stdio). Copy respects the “Pin version” switch above.
claude_desktop_config.json
{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview@0.6.28"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}Format verified against the official Claude Desktop docs ↗.
terminal
claude mcp add --env SQL_PREVIEW_CONNECTIONS=<YOUR_SQL_PREVIEW_CONNECTIONS> sql-preview -- npx -y sql-preview
claude mcp add --env SQL_PREVIEW_CONNECTIONS=<YOUR_SQL_PREVIEW_CONNECTIONS> sql-preview -- npx -y sql-preview@0.6.28
Format verified against the official Claude Code docs ↗.
.cursor/mcp.json
{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview@0.6.28"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}Format verified against the official Cursor docs ↗.
.vscode/mcp.json
{
"servers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}{
"servers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview@0.6.28"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}Format verified against the official VS Code docs ↗.
mcp_config.json
{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview@0.6.28"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<YOUR_SQL_PREVIEW_CONNECTIONS>"
}
}
}
}Format verified against the official Windsurf docs ↗.
Defined in the server's official registry manifest. Required secrets are shown as <YOUR_…> placeholders in the configs above.
SQL_PREVIEW_CONNECTIONS secret — JSON array of SQL Preview connection profiles for headless use.SQL_PREVIEW_MCP_SAFE_MODE — Set to false to allow mutating SQL. Defaults to true.SQL_PREVIEW_MAX_ROWS — Maximum rows returned by query tools. Defaults to 10000.Distributed as npm, listed under Databases. Review our MCP security guide before granting access to real data.
Run the install command shown above, then paste the config for your client (Claude Desktop, Claude Code, Cursor, VS Code or Windsurf) into its MCP settings and restart the client.
The MCP server itself is free to install. The source is public on https://github.com/fadnavismehul/sql-preview. Any third-party service it calls may require its own API key and account.
Any MCP-compatible client can use it, including Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and custom agents.
Publish this server? Link back with a badge on your README or site — copy either snippet.
Markdown
[](https://mcpnav.net/server/sql-preview/)
HTML
<a href="https://mcpnav.net/server/sql-preview/"><img src="https://mcpnav.net/badge/sql-preview.svg" alt="Listed on MCPNav" height="20"></a>