sqlike-mcp — Claude Code MCP server: what it does, how to install
sqlike-mcp — an MCP server that checks SQL queries for errors, anti-patterns and suggests indexes. Compares two queries to verify a rewrite did not change the result.
Apache-2.0 ★ 8 updated 2026-10-24
claude mcp add sqlike-mcp -e SQLIKE_API_KEY=<SQLIKE_API_KEY> -- npx -y @sqlike/mcpWhat sqlike-mcp does
The server tokenizes SQL locally and forwards it to a remote analysis engine, which returns a list of issues from a catalog of 172 rules: syntax errors, unsafe patterns like a LEFT JOIN turning into an INNER, a missing WHERE in an UPDATE. The engine also compares two queries and reports if they are equivalent — this verifies that a rewritten query by an LLM did not lose rows. Identifiers and literals are masked before transmission.
Two commands: analyze takes a query, optional schema (CREATE TABLE), table statistics and an execution plan, returns JSON with findings and index advice; diff compares two queries and gives a verdict (Equivalent, Differs, Undecided) with a report on columns, rows, cardinality. Supports Postgres, MySQL, MariaDB, SQLite, SQL Server, DuckDB. Without SQLIKE_API_KEY, the anonymous rate limit applies.
Requires Node.js and access to sqlike.com. The analysis engine is closed and does not run locally.
What it helps with
- check an SQL query before it runs against the database
- catch anti-patterns like a missing
WHEREin anUPDATE - verify that a rewritten query returns the same rows
- get index recommendations for a specific database engine
Example prompts for the agent
- Analyze
SELECT * FROM orders WHERE status = 'pending'and tell me what's wrong - Check if the two queries in
before.sqlandafter.sqlare equivalent - Suggest indexes for this query, here's the schema from
schema.sqland theEXPLAINplan
How to install sqlike-mcp
Platform CLI
claude mcp add sqlike-mcp -e SQLIKE_API_KEY=<SQLIKE_API_KEY> -- npx -y @sqlike/mcpReplace <…> with your own values
Platform CLI
codex mcp add sqlike-mcp --env SQLIKE_API_KEY=<SQLIKE_API_KEY> -- npx -y @sqlike/mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"sqlike-mcp": {
"command": "npx",
"args": [
"-y",
"@sqlike/mcp"
],
"env": {
"SQLIKE_API_KEY": "<SQLIKE_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"sqlike-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@sqlike/mcp"
],
"env": {
"SQLIKE_API_KEY": "<SQLIKE_API_KEY>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SQLIKE_API_KEY=<SQLIKE_API_KEY> sqlike-mcp npx -y @sqlike/mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about sqlike-mcp
How to install sqlike-mcp in Claude Code?
Run claude mcp add sqlike-mcp -e SQLIKE_API_KEY=<SQLIKE_API_KEY> -- npx -y @sqlike/mcp, replacing the placeholder with your key or removing -e SQLIKE_API_KEY=<SQLIKE_API_KEY> for anonymous access.
What does sqlike-mcp do?
Checks SQL queries via a remote engine: finds errors and anti-patterns from 172 rules, suggests indexes, and compares two queries to determine if a rewrite changed the result.
Which databases does sqlike-mcp support?
Postgres, MySQL, MariaDB, SQLite, SQL Server and DuckDB. Rules are verified against each engine's behaviour; DuckDB gets four columnar advisors instead of ten index ones.