Nlqueries logo

Nlqueries

by nlqueries

Converts natural-language questions into validated SQL and document answers through an MCP server.

Install Nlqueries

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "nlqueries-nlqueries": {
      "command": "uvx",
      "args": [
        "nlqueries-core"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "YOUR_VALUE_HERE",
        "OPENAI_API_KEY": "YOUR_VALUE_HERE",
        "QDRANT_API_KEY": "YOUR_VALUE_HERE",
        "NLQ_MCP_STATIC_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx nlqueries-core

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

nlqueries/nlqueries connects AI assistants to databases and documents, turning plain-language questions into validated SQL or cited document answers. It supports PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, SQL Server, DuckDB, SQLite, Notion, Confluence, and other SQLAlchemy-accessible databases. The MCP interface exposes query execution plus schema and knowledge-base lookup, while Qdrant supports embeddings, document search, and semantic caching. Reach for it when an agent needs conversational analytics across connected data sources or cited answers from ingested documents.

Use cases

  • Query business databases with natural-language questions
  • Ask cited questions about ingested company documents
  • Build a schema-aware knowledge base from query history
  • Reuse validated SQL through semantic caching
  • Evaluate generated queries against regression question sets

Key features

  • Natural-language to validated SQL
  • Multi-database and SQLAlchemy connectivity
  • Cited document question answering
  • Conversational query follow-ups
  • Semantic caching with Qdrant
  • MCP tools for query and schema access

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

27/27 checks healthy over the last 111d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · nlqueries-core (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Nlqueries works

What nlqueries/nlqueries does

nlqueries/nlqueries is a Python-based natural-language query engine and self-hosted MCP server. It translates plain-English questions into SQL, validates the generated query against the known schema, and can execute it against a configured database. The project also supports question answering over ingested documents, returning citations for information drawn from those sources.

Database connectivity covers PostgreSQL, Snowflake, BigQuery, Redshift, SQL Server and Azure SQL, DuckDB, SQLite, and MySQL through the generic SQLAlchemy connector. Any other database reachable through an appropriate SQLAlchemy driver can use that connector as well. Document sources include PDF, Word, Excel, Markdown, plain text, Notion, and Confluence.

How it works

A typical setup connects a database, processes query history, and exports a YAML knowledge base containing schema information and reusable query capsules. Query history can be filtered, clustered, and parameterized before it becomes part of that knowledge base. dbt model and column descriptions can also be imported.

The query workflow supports conversational follow-ups. After one question, a request such as asking for the same result “by region” can use the earlier query context. Sessions are enabled by default for the CLI query command and can be reset or disabled with its session flags.

Document ingestion chunks and embeds source content into Qdrant. Subsequent document questions retrieve relevant material and produce cited answers. The semantic cache can recognize previously answered database questions by meaning, replay the stored answer, and execute the stored SQL again so returned rows remain current. This cache requires Qdrant and does not apply to the ask command.

Setup and configuration

Python 3.11 through 3.14 is supported. Installation options include the nlqueries-core package, a source checkout, or Docker Compose. The package has optional extras for MySQL, Snowflake, BigQuery, Redshift, SQL Server, DuckDB, document ingestion, and Notion or Confluence synchronization. PostgreSQL and SQLite do not require an extra.

Docker Compose starts the core service and Qdrant, exposing the MCP endpoint at http://localhost:8080/sse. A network client authenticates with a bearer token supplied through NLQ_MCP_STATIC_TOKEN. The Docker setup requires a supported LLM provider key, QDRANT_API_KEY, and the MCP token. Anthropic and OpenAI are supported directly; Amazon Bedrock and LiteLLM-compatible providers are also available.

Tools and capabilities

  • Execute natural-language database queries through the MCP interface.
  • Look up database schema and generated knowledge-base content from MCP clients.
  • Answer questions over connected documents with citations.
  • Maintain reusable query capsules and report knowledge-base coverage with kb-stats.
  • Reuse positive feedback after re-validating its SQL against the current schema.
  • Run regression checks against mined capsules and optional golden questions.
  • Keep an embedding model resident with the embedding daemon to reduce repeated embedding latency.

The command-line interface is available as nlqueries, with nlq as a shorter alias. It provides connection, knowledge-base, query, document, feedback, evaluation, and health commands.

Limitations and notes

The Docker image includes PostgreSQL, SQLite, Snowflake, BigQuery, and DuckDB drivers, but not MySQL, Redshift, or SQL Server drivers. It also excludes the document and wiki extras, so those capabilities require a package installation with the relevant extras. Semantic caching and document search depend on Qdrant. The MCP token used by the basic Docker configuration grants full access; more granular access requires the authentication configuration described by the project.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Nlqueries

nlqueries/nlqueries is an MCP server that connects AI assistants to SQL databases and document sources. Its main tools support natural-language database querying, query execution, schema and knowledge-base lookup, and document question answering with citations. It can also use Qdrant for document search and semantic caching.

Install the `nlqueries-core` Python package, run it from a source checkout, or start the Docker Compose stack. Python 3.11–3.14 is supported. Docker requires an LLM key, `QDRANT_API_KEY`, and `NLQ_MCP_STATIC_TOKEN`; pip users can add connector, document, or wiki extras as needed.

Yes, nlqueries/nlqueries documents Claude Desktop connectivity. The Docker setup exposes an SSE endpoint at `http://localhost:8080/sse`, and the client must send an authorization bearer token using the configured MCP token.

Yes, nlqueries/nlqueries documents Cursor connectivity. A client connects to the MCP server endpoint and authenticates with the bearer token configured through `NLQ_MCP_STATIC_TOKEN` when using the Docker deployment.

Semantic caching matches a database question or MCP `query` request to a previously answered question, then reuses its answer and executes the saved SQL again for current rows. It requires Qdrant, does not apply to `ask`, and can be disabled for execution with the relevant no-execute option.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewNlqueries AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/nlqueries-nlqueries?style=directory)](https://allmcps.com/mcp/nlqueries-nlqueries)
HTML Embed
<a href="https://allmcps.com/mcp/nlqueries-nlqueries"><img src="https://allmcps.com/api/badge/nlqueries-nlqueries?style=directory" alt="Nlqueries on AllMCPs" /></a>