Pretensor MCP Server

Combine extras with comma separation, e.g. `pip install 'pretensor[postgres,clustering]'`.

Local serverstdioPython

What is the Pretensor MCP server?

Connect Pretensor to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Combine extras with comma separation, e.g. pip install 'pretensor[postgres,clustering]'. The pretensor mcp server is what makes that connection.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • list_databases — List indexed database connections with table counts and staleness
  • schema — Inspect node labels, edge types, and available properties before writing Cypher
  • query — BM25 keyword search over table and entity metadata. Hybrid BM25 + cosine RRF rerank when [embeddings] is installed and tables carry vectors
  • semantic_search — Cosine ranking over indexed SchemaTable embeddings. Requires pretensor[embeddings]; returns a structured BM25-fallback envelope when the extra is
  • cypher — Read-only Kuzu Cypher for one indexed database; mutating clauses are rejected
  • context — Full context for one physical table, including columns, joins, lineage, and cluster metadata. Optional include_similar arg surfaces cross-cluster
  • traverse — Join paths between two physical tables. When ambiguous and tables carry embeddings, ranks tied paths by embedding similarity
  • impact — Downstream tables reachable from a table via FK and inferred-join edges
  • detect_changes — Compare the live database schema to the last indexed snapshot without mutating the graph
  • compile_metric — Compile semantic-layer YAML into validated SQL for one indexed database. The error string includes a "did you mean: …" suggestion list when an
  • validate_sql — Validate SQL against the indexed graph before execution

Credentials and setup notes

  • Python 3.11 or 3.12 (3.13 not yet tested). - A reachable database for pretensor index. Every database driver ships as an extra — PostgreSQL via pretensor[postgres], Snowflake via pretensor[snowflake], BigQuery via pretensor[bigquery].

Installation

The server ships on PyPI as pretensor, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Where it fits

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Pretensor's toolset — list_databases, schema, query and 8 more — is a fair guide to whether it matches your workflow. It is maintained by pretensor-ai; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Pretensor.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
list_databasesList indexed database connections with table counts and staleness.
schemaInspect node labels, edge types, and available properties before writing Cypher.
queryBM25 keyword search over table and entity metadata. Hybrid BM25 + cosine RRF rerank when [embeddings] is installed and tables carry vectors.
semantic_searchCosine ranking over indexed SchemaTable embeddings. Requires pretensor[embeddings]; returns a structured BM25-fallback envelope when the extra is absent or no tables have been embedded.
cypherRead-only Kuzu Cypher for one indexed database; mutating clauses are rejected.
contextFull context for one physical table, including columns, joins, lineage, and cluster metadata. Optional include_similar arg surfaces cross-cluster nearest neighbors when embeddings are present.
traverseJoin paths between two physical tables. When ambiguous and tables carry embeddings, ranks tied paths by embedding similarity.
impactDownstream tables reachable from a table via FK and inferred-join edges.
detect_changesCompare the live database schema to the last indexed snapshot without mutating the graph.
compile_metricCompile semantic-layer YAML into validated SQL for one indexed database. The error string includes a "did you mean: …" suggestion list when an unresolved metric, table, or column name has close matches.
validate_sqlValidate SQL against the indexed graph before execution.

How to install the Pretensor MCP server

{
  "mcpServers": {
    "pretensor": {
      "command": "uvx",
      "args": ["pretensor"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.11 or 3.12 (3.13 not yet tested). - A reachable database for pretensor index. Every database driver ships as an extra — PostgreSQL via pretensor[postgres], Snowflake via pretensor[snowflake], BigQuery via pretensor[bigquery].

Example prompts to try

  • Use Pretensor to list databases.
  • Use Pretensor to schema.
  • Use Pretensor to query.

Frequently asked questions

It connects Pretensor to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (list_databases, schema, query, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Pretensor directly.