# nlqueries/nlqueries [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/nlqueries/nlqueries  
**GitHub Stars:** 5  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/nlqueries-nlqueries

## Description
Natural language to validated SQL engine with multi-connector support (PostgreSQL, MySQL, Snowflake, BigQuery, DuckDB), document QA, semantic caching, and self-hosted MCP server.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "nlqueries": {
    "command": "uvx",
    "args": ["nlqueries-core"],
    "env": {
      "ANTHROPIC_API_KEY": "",
      "OPENAI_API_KEY": "",
      "QDRANT_API_KEY": "",
      "NLQ_MCP_STATIC_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `QDRANT_API_KEY`, `NLQ_MCP_STATIC_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/nlqueries-nlqueries/readme_

