QueryDeck Docs
MCP Server

MCP Server overview

Connect Claude Desktop, Claude Code, Cursor, and Windsurf to your databases through QueryDeck.

For: developers using AI editors.

QueryDeck includes a Model Context Protocol (MCP) server. Once installed, your AI editor can query your databases through QueryDeck — it sees the same schema, runs the same connections, and respects the same safety rules as the QueryDeck app.

What is MCP?

MCP is a standard from Anthropic for letting AI models talk to local tools. An MCP server exposes a set of "tools" (functions) that the model can call. QueryDeck's MCP server exposes five tools that wrap its database engine, schema introspection, and Drift Mode.

When you ask Claude or Cursor a question like "what columns does the orders table have?", the editor calls QueryDeck's get_schema tool. When you ask "how many users signed up this week?", it calls execute_query with a generated SELECT. The AI model never connects directly to your database — every call goes through QueryDeck, which enforces the safety configuration you set.

What you get

Once installed, your AI editor can:

  • Read your schema — list tables, describe columns, find tables matching a name, follow foreign keys.
  • Run read queriesSELECT queries are run against the connection you've configured.
  • Explain a query — get the planner's view of how a query will execute.
  • Check schema drift — compare your ORM schema to the live database from inside the editor.

By default, the AI can only read. Write operations (INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE, CREATE, GRANT, REVOKE) are blocked. See Safety for the full policy.

How the pieces fit together

┌────────────┐    MCP stdio    ┌──────────────┐  Unix socket  ┌────────────┐
│   Claude   │ ───────────────▶ │ querydeck-mcp │ ────────────▶ │  QueryDeck │
│  / Cursor  │ ◀─────────────── │   (helper)    │ ◀──────────── │   app      │
└────────────┘                  └──────────────┘                 └────────────┘

                                                              libpq / libmysql / sqlite


                                                                ┌────────────┐
                                                                │  Databases │
                                                                └────────────┘
  • querydeck-mcp is a tiny helper binary. It speaks MCP over stdio (the protocol AI editors use) and proxies requests to the QueryDeck app over a local Unix socket.
  • QueryDeck app owns the connections, the safety config, and the actual database work. It must be running for the MCP server to work.
  • AI editor spawns querydeck-mcp on demand and tears it down when it's done.

This architecture means:

  • Your credentials never leave the QueryDeck app — the AI editor only ever sees the tool results.
  • Safety rules (read-only by default, row limits, query timeouts) are enforced in one place.
  • Multiple editors can use QueryDeck at once — querydeck-mcp is a thin proxy.

Supported clients

QueryDeck ships with auto-installers for four AI editors:

EditorConfig file
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json
Claude Code~/.claude/settings.json
Cursor~/.cursor/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json

Any MCP-compatible client can talk to querydeck-mcp — point its config at the binary path and you're set. See Install for the manual setup.

What's next

  • Installqdeck mcp install in one command
  • Tools — the 5 tools, their parameters, and what they return
  • Safety — read-only by default, row limit, query timeout
  • Uninstall — clean removal from one or all clients