Standalone Postgres MCP server β schema-aware, read-only by default, installable everywhere.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Standalone Postgres MCP server β schema-aware, read-only by default, installable everywhere.
NexQL Pro ships an in-process MCP server locked to VS Code (pro/src/mcp/). This repo extracts that capability into an independent Rust binary any MCP client can spawn: Claude Desktop, Cursor, VS Code Copilot, Zed, etc.
Status: Phases 0β6 + Phase 7 extension cutover (stdio spawn) + Phase 8 HTTP (bearer, sessions, rate limit) + Phase 9 write/admin tools landed. 53 tools across Schema, Query, Context, Perf, Write, and Admin. Full OAuth gateway stays pro-only; session-store LRU eviction cap not yet implemented. See docs/CUTOVER.md.
Competing Postgres MCP servers expose connect β run query β return rows. Models hallucinate table names against schemas that do not exist. NexQL's moat is the offline schema index (TF-IDF, join graph with inferred FKs, value profiles, optional embeddings, RRF fusion) built in pro/src/features/dbindex/. This repo ports that index plus 53 query/schema/DBA/meta tools from Pro into a fast, trivially installable binary.
Layering is one-directional: policy + conn are leaves β index β tools β binary. nexql-tools never depends on nexql-proto.
Pick whichever fits your workflow β all methods ship the same binary.
Linux system requirements: prebuilt GNU/Linux binaries target glibc 2.35+ (Ubuntu 22.04, Debian 12, RHEL 9, and newer). Releases from v0.2.1 and earlier were built on Ubuntu 24.04 and require glibc 2.39 β if npm install nexql-mcp fails with GLIBC_2.39 not found, upgrade to the next release, use cargo install (builds from source), or run the Docker image. Musl/static Linux builds are not published yet.
Linux & macOS β downloads the latest release, installs to /usr/local/bin (or ~/.local/bin if sudo is unavailable), then prints setup steps:
Pin a version:
Windows (PowerShell) β installs to %LOCALAPPDATA%\Programs\nexql-mcp and adds it to your user PATH:
Pin a version:
Or download and run the scripts locally: scripts/install.sh Β· scripts/install.ps1.
Per-client config paths and paste blocks: docs/clients/README.md.
nexql-mcp is a shim (npm/bin/nexql-mcp.js) that resolves the right prebuilt binary from a per-platform optionalDependency (@nexql/mcp-<os>-<arch>) β no Rust toolchain needed.
uv installs CLI tools from PyPI into isolated environments β same prebuilt binary, no Rust toolchain.
Install uv itself (if needed):
Install nexql-mcp:
One-off without installing:
Pin a version:
Upgrade later:
Then follow After install above.
PyPI status: wheels are not published yet. Until the first PyPI release lands, use quick install or npm. Maintainer steps: docs/publish-pypi-uv.md.
Builds from source, so you need clang/libclang first (pg_query's bindgen requires it):
Prefer the quick install scripts above. To install by hand, grab the archive for your platform from the Releases page:
| Platform | Archive |
|---|---|
| Linux x64 | nexql-mcp-<tag>-x86_64-unknown-linux-gnu.tar.gz |
| Linux arm64 | nexql-mcp-<tag>-aarch64-unknown-linux-gnu.tar.gz |
| macOS Intel | nexql-mcp-<tag>-x86_64-apple-darwin.tar.gz |
| macOS Apple Silicon | nexql-mcp-<tag>-aarch64-apple-darwin.tar.gz |
| Windows x64 | nexql-mcp-<tag>-x86_64-pc-windows-msvc.tar.gz |
Extract and put nexql-mcp (or nexql-mcp.exe) on your PATH, then follow After install above.
Prebuilt, published on every release to GHCR:
Or build locally from the distroless Dockerfile:
Each release attaches a platform .mcpb bundle (nexql-mcp-<vendor>.mcpb) β download the one matching
your OS/arch from the Releases page and double-click
to install into Claude Desktop. Built from mcpb/manifest.json via
scripts/package-mcpb.sh.
No published tap yet β each release renders a formula (Formula/nexql-mcp.rb, via
scripts/render-homebrew-formula.sh) and attaches it as a release
asset for a future homebrew-tap repo to pick up. Until that tap exists, use the quick install or cargo methods
above.
Listed in the official MCP Registry as
io.github.NexQL-OSS/nexql-mcp (server.json), published automatically after each
release via GitHub OIDC (no stored credentials) β see
.github/workflows/publish-mcp-registry.yml.
One-off, no config β pass a connection string directly:
Saved profiles β put connections in ~/.config/nexql-mcp/config.toml (override the path with NEXQL_MCP_CONFIG):
Full field reference: docs/config.example.toml. Then run bare (nexql-mcp) to use default_profile, or nexql-mcp --profile prod.
Test a connection before wiring it into a client:
Guided setup β an interactive profile editor plus one-keystroke wiring into whichever clients you use: nexql-mcp tui (see Interactive TUI below).
Supported init clients: claude | claude-desktop | claude-code | cursor | vscode | vscode-copilot | zed | windsurf | continue | jetbrains | openai-agents.
Per-client paste blocks: docs/clients/README.md.
If you already use ric-v.postgres-explorer (+ NexQL Pro), you don't need any of the above β the extension can spawn this binary itself and reuse your existing saved connections instead of a separate config.toml.
postgresExplorer.mcp.enabled) β check it. Off by default.postgresExplorer.connections. It shows up as an MCP server named NexQL in Copilot Chat / agent-mode tool pickers.The extension resolves the binary in this order: postgresExplorer.mcp.binaryPath setting β NEXQL_MCP_BIN env var β a copy bundled with the extension β whatever nexql-mcp is on your PATH (i.e. anything installed via npm/cargo/curl above). Set postgresExplorer.mcp.binaryPath explicitly if you want the extension to use a specific install.
Guided profile editor: add/edit/delete a connection profile, test-connect it live before saving, then pick any of 7 clients (Claude Desktop, Claude Code, Cursor, VS Code, Copilot Chat, Zed, Windsurf) to wire it into at once. Each selected client's real config file is read, merged (existing unrelated servers are preserved), shown as a diff, and only written after you confirm β a timestamped backup is kept alongside it. continue / jetbrains / openai-agents have no safe on-disk merge target, so those stay copy-paste snippets in the summary screen, same as init.
Keys: n new Β· e/Enter edit Β· d delete Β· t test Β· w wire into clients Β· q quit. Bare nexql-mcp (no URL, no flags) launches the TUI automatically when nothing else resolves a connection.
Pushing a v* tag triggers .github/workflows/release.yml: builds
darwin arm64/x64, linux gnu arm64/x64, and windows x64; attaches archives, per-platform .mcpb bundles,
a CycloneDX SBOM, and a rendered Homebrew formula to a GitHub release; publishes the npm packages and
GHCR image; and publishes the workspace crates to crates.io in dependency order. A follow-up workflow
(publish-mcp-registry.yml) then lists the release on the
MCP Registry via GitHub OIDC. Linux GNU binaries are built on Ubuntu 22.04 (glibc 2.35). Musl targets remain deferred until a clang-enabled musl builder is validated.
Read CLAUDE.md and docs/REFERENCE.md before implementing.
GPL-3.0-only for all crates in this repo, from v0.2.0 onward. If you distribute this program or a derivative β including bundled inside another application β you must release your source under the GPL as well.
Releases up to and including v0.1.6 were published under Apache-2.0. That grant is irrevocable for those versions and is unaffected by this change.
Copyright is held solely by the NexQL-OSS Team, so commercial licenses that lift the GPL obligation are available on request. Premium extensions (provider embeddings, team sync, hosted gateway) live in a separate proprietary crate.
| Phase | Deliverable |
|---|---|
| 0 | Spike: tokio-postgres + candle MiniLM proof |
| 1 | nexql-conn + nexql-policy + pg_query validator |
| 2 | MCP stdio transport + ~8 catalog tools |
| 3 | nexql-index (byte-compatible with TS format) |
| 4 | Full tool surface, resources, prompts, completions |
| 5 | Local embeddings + RRF fusion |
| 6 | v1.0 ship: cargo-dist, npm, brew, Docker, MCPB |
| 7 | Extension cutover β VS Code spawns binary via stdio MCP definition |
| 8 | Streamable HTTP + bearer token (--http / NEXQL_MCP_HTTP_TOKEN) β OAuth gateway = pro |
| 9 | Write/admin tools + validate_write_sql (opt-in --access-mode write|admin) |
Full plan: internal design doc (federated-greeting-badger). Cutover details: docs/CUTOVER.md.
TypeScript sources in the sibling nexql-pro checkout (chat still uses these; MCP HTTP stack removed):
pro/src/mcp/McpDefinitionProvider.ts β stdio spawn of this binarypro/src/mcp/NexqlMcpStdioHost.ts β ephemeral profile + binary resolvepro/src/providers/chat/tools/ToolSpec.tspro/src/providers/chat/tools/ToolExecutor.tspro/src/features/dbindex/*Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/nexql-postgres-mcp)<a href="https://allmcps.com/mcp/nexql-postgres-mcp"><img src="https://allmcps.com/api/badge/nexql-postgres-mcp?style=directory" alt="NexQL Postgres MCP on AllMCPs" /></a>