factql-mcp
OfficialThis MCP server lets you ask plain-English questions about connected data and check what your FactQL API key can access.
whoami()— see the tenant, plan, workspaces the key may query, and whether any data is connected.ask(question, workspace_id?, locale?)— get an answer with the SQL that ran and up to 50 returned rows, optionally scoped to a workspace and usingen-GBoren-USwording.Handles vague questions, unverifiable answers, errors, missing data, schema preparation, email verification, and plan limits with actionable messages.
Works with connected Postgres, MySQL, DuckDB, CSV/XLSX uploads, and PDFs, running only read-only
SELECTqueries under key permissions.Can be used from Claude, Claude Code, Cursor, VS Code, or any MCP client, including FactQL's hosted remote server.
Enables asking natural-language questions against DuckDB data, with FactQL running verified SQL queries and returning the query, result rows, and lineage.
Enables asking natural-language questions against MySQL databases, with FactQL running verified SELECT queries and returning the SQL, result rows, and lineage.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
factql-mcp
Ask your database questions in plain English from Claude, Claude Code, Cursor, VS Code or any MCP client.
Each answer comes with the SQL that ran and the rows it returned, so you can check the number. Works with Postgres, MySQL, DuckDB, uploaded CSV and XLSX files, and PDFs.
Built for developers putting AI near real data: AI apps, agents and internal tools that can't afford a confident wrong number.
This package is FactQL's MCP server: it brings those answers into Claude Desktop, Claude Code, Cursor, or any MCP client. Learn more at factql.ai.
Hosted server (no install)
FactQL also runs this server for you at:
https://api.factql.ai/mcpAdd it as a remote (Streamable HTTP) MCP server in Claude (Settings → Connectors → Add custom connector; works on web, desktop and mobile), Claude Code (claude mcp add --transport http factql https://api.factql.ai/mcp), Cursor, VS Code, or any app that supports remote MCP. The app opens a FactQL sign-in page; click Allow and its questions run as you. Disconnect under Settings → Connected apps on factql.ai. Apps that can't sign in can send an API key as Authorization: Bearer fl_live_... instead.
Setup for each app: docs.factql.ai/guides/mcp.
The rest of this README is for running the server yourself.
Related MCP server: Footnote
Get a key
Sign up free at factql.ai/signup, connect your data, and create an API key. An ask-only key is enough for this server.
Install
uvx factql-mcpor pip install factql-mcp.
Configure
Variable | Required | Default |
| yes | — your FactQL API key (an ask-only key is enough) |
| no |
|
| no | default workspace, for tenants that use workspaces |
| no |
|
Claude Desktop / Cursor (mcpServers)
{
"mcpServers": {
"factql": {
"command": "uvx",
"args": ["factql-mcp"],
"env": { "FACTQL_API_KEY": "fl_live_..." }
}
}
}Claude Code
claude mcp add factql -e FACTQL_API_KEY=fl_live_... -- uvx factql-mcpTools
whoami()— the tenant, plan, and workspaces this key can query, andhas_data: whether anything is connected yet.ask(question, workspace_id?, locale?)— the answer, the SQL that ran, and up to 50 rows. Aneeds_clarificationresult means the question was too vague; ask the user and call again with the detail. Adeclinedresult means FactQL couldn't verify an answer and gave none rather than guess; thereasonsays why. Anerrorresult is a real failure, also with areason.localeisen-GBoren-US.
When FactQL can't answer yet, ask returns one of these, with a message saying what to do next:
|
|
| No data is connected to this FactQL workspace yet. Add a database or upload a CSV or Excel file at https://factql.ai, then ask again. |
| Your data is still being prepared. Try again in a minute or two. |
| Verify your email to start asking. Check your inbox for the link from FactQL. |
| The plan-limit message from FactQL, unchanged. |
Each ask is stateless: the MCP client carries the conversation, so a follow-up should restate what it refers to.
Safety
FactQL only runs read-only SELECT queries, under a statement timeout, and only against the tables your admin has described to it (inside a workspace, only that workspace's tables). The key's permissions decide what it can see; this server adds nothing on top.
Development
uv run --with pytest pytest -qLicense
MIT
Questions and feedback
Ask in Discussions or email ask@factql.ai. Bugs go in Issues.
Available Tools
2 toolsaskAInspect
Ask a plain-English question about the connected data.
Returns the answer, the SQL that was run (when any), and up to 50 rows.
workspace_id scopes the question when the tenant uses workspaces
(see whoami); locale is "en-GB" or "en-US" for the answer's wording.
A needs_clarification result means the question was too vague: ask the
user, then call again with the detail.
Inputs: question (required), locale, workspace_id. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools are clearly distinct: `whoami` retrieves tenant/plan/workspace context, while `ask` runs a natural-language query. The description of `ask` even points to `whoami` for discovering workspace_id, reinforcing the division of labor.
Both names are single lowercase words in a consistent informal, command-style convention (whoami, ask), with no mixing of snake_case/camelCase. There is no verb_noun pattern, but across only two tools the style is predictable and readable.
Two tools is on the thin side, though the server's narrow purpose (context discovery + one NL query entry point) means each tool does earn its place. It sits at the borderline rather than being over- or under-scoped badly.
The surface covers identity and querying but has no schema/table introspection helper and no pagination or continuation mechanism beyond the fixed 50-row cap. Agents can often work around these limits via `whoami` and re-asking, but they are notable gaps for a data-query server.
Related MCP Connectors
Fact-checks generated content against your sources of truth showing what to trust, change, & verify.
Cross-check a factual claim against a verified knowledge graph before you assert it. Never guesses.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Deterministic fact verification for AI agents — checksums & curated data, not guesses.
Related MCP Servers
- AlicenseAqualityDmaintenanceQuery SQL databases (SQLite, PostgreSQL, BigQuery, Databricks) in natural language through a business semantic layer — glossary, metrics, and a data dictionary grounded against your real schema. Read-only by default, with an embedded SQLite + sqlite-vec metadata store and no external infra required.253MIT
- AlicenseAqualityBmaintenanceThis MCP server gives AI assistants over business data a provenance layer: every number in an answer traces back to specific records, auditable and tamper-evident. It enforces that the model never generates figures—only selects operations whose results are computed deterministically in SQL.6133 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables natural language queries to be converted into policy-verified SQL, vector search, and knowledge graph plans, with evidence-backed answers and an audit log.1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query governed data warehouses through plain language, returning grounded answers with SQL, confidence grades, and signed receipts while enforcing access, testing, and audit controls.37 PyPI18Apache 2.0