querywise-mcp
An MCP server (and a CLI) that lets an LLM query your databases in natural language through a business semantic layer — glossary, metric definitions, data dictionary, knowledge base, and example queries — grounded against your real schema.
It's a refactor of QueryWise (a full-stack text-to-SQL app) into a headless tool: no web UI, no Postgres requirement. The metadata store is an embedded SQLite + sqlite-vec database, so the server runs from a single file.
Two ways to use it
- As an MCP server — Claude (or any MCP client) calls the tools. The
recommended loop is:
get_semantic_context(connection, question)→ the model writes a read-onlySELECT→run_sql(connection, sql). The client's own model does the reasoning; the server provides grounded context + safe execution. - As a CLI —
querywise ask <connection> "<question>"runs the full server-side NL→SQL pipeline (compose → validate → execute → interpret). This path needs an LLM provider key (or local Ollama).






