About FactQL
FactQL is an MCP server for developers building AI applications and internal tools around real data. It verifies answers and returns the executed query, result rows, and lineage, declining when it cannot verify a result.
Key features
- 01Verified answers from connected data
- 02Executed SQL included with answers
- 03Returned rows and data lineage
- 04Clarification and decline results
- 05SELECT-only queries with timeouts
Use cases
- 01Answering questions over business databases
- 02Querying uploaded CSV and XLSX files
- 03Providing cited answers from PDFs
- 04Adding data-backed answers to MCP clients
MCP support
FactQL exposes `whoami` and `ask` tools to MCP clients, including Claude Desktop, Claude Code, and Cursor. It can run as a hosted remote server or locally with an API key.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://api.factql.ai/mcpclaude mcp add --transport http factql-factql https://api.factql.ai/mcp{"mcpServers":{"factql-factql":{"type":"http","url":"https://api.factql.ai/mcp"}}}Open in Cursor{"servers":{"factql-factql":{"type":"http","url":"https://api.factql.ai/mcp"}}}Open in VS Code{"mcpServers":{"factql-factql":{"type":"http","url":"https://api.factql.ai/mcp"}}}{"mcpServers":{"factql-factql":{"serverUrl":"https://api.factql.ai/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMEfactql-mcp
FactQL is the harness around the model.
Ask a question about your data. FactQL runs the query, checks the result before you see an answer, and declines instead of guessing when it can't verify.
Every answer ships with the query that ran, the rows it returned and the lineage behind it. One API call. Works with Postgres, MySQL, DuckDB, uploaded CSV and XLSX files, and PDFs with cited answers.
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/mcp
Add 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.
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-mcp
or pip install factql-mcp.
Configure
| Variable | Required | Default |
|---|---|---|
FACTQL_API_KEY | yes | — your FactQL API key (an ask-only key is enough) |
FACTQL_BASE_URL | no | https://api.factql.ai |
FACTQL_WORKSPACE_ID | no | default workspace, for tenants that use workspaces |
FACTQL_END_USER_ID | no | mcp:<os user> |
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-mcp
Tools
whoami()— the tenant, plan, and workspaces this key can query.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.localeisen-GBoren-US.
Each ask is stateless: the MCP client carries the conversation, so a follow-up should restate what it refers to.
Safety
FactQL only runs SELECT queries, under a statement timeout, and only against the tables your admin has enabled. The key's permissions decide what it can see; this server adds nothing on top.
Development
uv run --with pytest pytest -q
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.