SQL Preview
Run governed SQL queries and inspect database schemas from MCP agents.
Install
Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).
sql-previewclaude mcp add sql-preview -e 'SQL_PREVIEW_CONNECTIONS=<your sql_preview_connections>' -e 'SQL_PREVIEW_MCP_SAFE_MODE=<SQL_PREVIEW_MCP_SAFE_MODE>' -e 'SQL_PREVIEW_MAX_ROWS=<SQL_PREVIEW_MAX_ROWS>' -- npx -y sql-preview@0.6.28 --stdio
{
"mcpServers": {
"sql-preview": {
"command": "npx",
"args": [
"-y",
"sql-preview@0.6.28",
"--stdio"
],
"env": {
"SQL_PREVIEW_CONNECTIONS": "<your sql_preview_connections>",
"SQL_PREVIEW_MCP_SAFE_MODE": "<SQL_PREVIEW_MCP_SAFE_MODE>",
"SQL_PREVIEW_MAX_ROWS": "<SQL_PREVIEW_MAX_ROWS>"
}
}
}
}
Environment variables
SQL_PREVIEW_CONNECTIONSsecret JSON array of SQL Preview connection profiles for headless use.SQL_PREVIEW_MCP_SAFE_MODESet to false to allow mutating SQL. Defaults to true.SQL_PREVIEW_MAX_ROWSMaximum rows returned by query tools. Defaults to 10000.
Frequently asked questions
What is SQL Preview?
Run governed SQL queries and inspect database schemas from MCP agents.
How do I install SQL Preview?
It runs on your machine. In Claude Code: claude mcp add sql-preview -e 'SQL_PREVIEW_CONNECTIONS=<your sql_preview_connections>' -e 'SQL_PREVIEW_MCP_SAFE_MODE=<SQL_PREVIEW_MCP_SAFE_MODE>' -e 'SQL_PREVIEW_MAX_ROWS=<SQL_PREVIEW_MAX_ROWS>' -- npx -y sql-preview@0.6.28 --stdio. For other clients, paste the JSON configuration from this page into their MCP settings.
Does SQL Preview need an API key?
Yes. It expects SQL_PREVIEW_CONNECTIONS, which you set in its configuration.
Is SQL Preview open source?
Its code is public on GitHub, but the repository does not declare a standard license.
Who maintains SQL Preview?
It is published by fadnavismehul. AI.tn lists it but does not maintain or endorse it.
From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.