Skip to main content
Glama
factql-mcp

factql-mcp

Official

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

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.

Related MCP server: Footnote

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. A needs_clarification result means the question was too vague; ask the user and call again with the detail. locale is en-GB or en-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

Available Tools

2 tools
askA

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.

NameRequiredDescriptionDefault
localeNo
questionYes
workspace_idNo

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does well: it discloses that a query is executed and the SQL is returned, that results are capped at 50 rows (implying truncation), and that `needs_clarification` is a distinct result state rather than a failure. It does not state whether execution is read-only or what permissions are required, which is the remaining gap for an unannotated query tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then return shape, then parameter semantics, then the clarification sentinel, in the order an agent needs them. No sentence is padding, and the parenthetical 'when any' efficiently conveys that not all queries produce SQL.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the return-value explanation is partly redundant, but the description adds the meaningful behavioral detail that results are capped at 50 rows and that `needs_clarification` is actionable. For a three-parameter read-oriented tool, the only material omission is permission or read-only behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it explains all three inputs: `workspace_id` scopes the question to a tenant workspace, `locale` takes 'en-GB' or 'en-US' and controls the answer's wording, and `question` is the plain-English query. The only shortfall is that it does not clarify what happens when `workspace_id` is omitted in a workspace-enabled tenant.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Ask a plain-English question about the connected data', which tells an agent exactly what class of operation this is (natural-language query over tenant data). It also references `whoami` for workspace discovery, so an agent can distinguish this from the sibling without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage flow: when `needs_clarification` comes back, ask the user and re-call with the added detail, and it points to `whoami` when a tenant uses workspaces. What is missing is any negative guidance, such as what kinds of questions this should not be used for, so the agent must infer the boundary itself.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

whoamiA

What this API key can see: tenant, plan, and the workspaces it may query.

Use it to find a workspace_id before calling ask on a tenant that uses workspaces.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it discloses the substantive behavior: this is a read-only introspection of the API key's tenant, plan, and queryable workspaces. It does not explicitly state side-effect freedom or auth requirements, but for a zero-parameter read tool the disclosed behavior is largely sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with what the tool reveals and followed by the concrete usage instruction. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description need not detail return values, and the zero-parameter schema is trivial. The remaining gap is minor: it could mention that tenants without workspaces can call `ask` directly, but the conditional phrasing already implies this.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is no parameter-level meaning to add. The description correctly omits parameter discussion and focuses on the output scope instead.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the exact information returned — tenant, plan, and the workspaces the API key may query — so the tool's job is unambiguous. It also implicitly distinguishes itself from the sibling `ask` by framing itself as the identity/scope lookup that precedes a query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a direct when-to-use instruction: call this first to obtain a `workspace_id` before calling `ask` on a tenant that uses workspaces. That is clear routing guidance, though it does not state when the tool is unnecessary (e.g. tenants without workspaces).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.1
    • First observedask
    • First observedwhoami

TDQS

A4.2/5.0

Scored across 2 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count3/5

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.

Completeness3/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Query 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.
    25
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    This 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.
    6
    106 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables natural language queries to be converted into policy-verified SQL, vector search, and knowledge graph plans, with evidence-backed answers and an audit log.
    1
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    252 PyPI
    17
    Apache 2.0