Pretensor
blog

MCP database tools: what exists and what's missing

A survey of MCP servers for databases — raw SQL executors, metadata readers, and the schema-intelligent tools that actually understand your tables.

  • mcp
  • comparison
  • database
  • tools

If you’re building AI agents that work with databases, you’ve probably searched for “MCP database server” and found a handful of options. They all fall into roughly two categories: SQL executors and metadata readers. Here’s what exists today, where the gaps are, and when you might want something more than either category provides.

This isn’t a “top 10 tools ranked” list. It’s a feature-model comparison aimed at data engineers evaluating MCP infrastructure. I’ll describe the categories generically — specific tools come and go, but the architectural choices don’t.

Category 1: Raw SQL executors

Most MCP database servers today do one thing: accept a SQL string, execute it, return rows. They wrap a database driver (psycopg2, snowflake-connector-python) in an MCP tool called query or execute_sql.

What they do well:

  • Fast to set up. One connection string, one tool.
  • Work for simple “give me the top 10 rows” queries.
  • Low maintenance — no schema storage, no state.

What they don’t do:

  • The agent has no schema awareness. It guesses column names and join paths.
  • No relationship discovery. The agent doesn’t know orders.customer_id → customers.id unless a human tells it.
  • No classification. All tables look the same to the agent — fact tables get equal priority to reference tables.
  • No change detection. The agent can’t tell if the schema changed since last session.
  • No cross-database awareness. Two separate MCP servers for two databases; the agent can’t connect them.

When to use: You have a small, stable schema (under ~30 tables), you know it well, and you just want the agent to run queries you’ve mentally validated. The agent is a SQL shortcut, not a schema navigator.

Category 2: Metadata readers

A smaller set of tools read database metadata and expose it to the agent. They might query information_schema and return table listings, column types, or constraint info through structured tools.

What they do well:

  • The agent can discover table names without human help.
  • Column types are surfaced, reducing type errors in generated queries.

What they don’t do:

  • Still no relationship discovery beyond explicit foreign keys.
  • No inferred joins — if two tables share customer_id but there’s no FK constraint, it’s invisible.
  • No semantic labels — a table called fact_daily_revenue is just a name, not classified as a fact table.
  • No persistence between sessions. The agent re-discovers the schema every time (or every time the human re-runs information_schema queries).
  • No precomputed join paths. The agent discovers paths by iterating, which is slow and error-prone.

When to use: You want slightly better schema awareness than raw SQL execution, but your schema is still small and well-constrained. The agent can discover table names, but it can’t reason about relationships.

Category 3: Schema-intelligent tools (what Pretensor does)

A third category exists — tools that don’t just read metadata but build a structural model of the database before the agent writes its first query. This is a graph-based approach rather than a query-based approach.

What’s different:

CapabilitySQL ExecutorMetadata ReaderSchema-Intelligent
Run SQL✅❌❌ (by design — see below)
List tables + columns❌✅✅
Explicit FKs❌✅ (if constrained)✅
Inferred joins❌❌✅
Table classification❌❌✅ (fact/dimension/bridge/junction…)
Join-path precomputation❌❌✅ (shortest paths)
Community clustering❌❌✅ (Louvain)
Impact analysis❌❌✅ (downstream dependencies)
Change detection❌❌✅ (live schema vs. indexed graph)
Cross-database paths❌❌✅
Persistent graph❌❌✅ (Kuzu, on-disk)
Deterministic (no LLM)✅✅✅

Why no SQL execution? Pretensor intentionally doesn’t include a run_sql tool. The schema graph is the agent’s source of truth; SQL execution is the agent’s own capability (Claude, Cursor, etc. can run SQL through their own tools or through your existing database MCP servers). Pretensor is the schema intelligence layer — it answers “what’s in my database and how does it relate?” while your existing tooling handles “run this query.”

This separation means you can use Pretensor alongside an existing SQL MCP server without conflict. The agent gets schema context from Pretensor, writes the query, and executes it through the other tool.

How the graph approach changes agent behavior

With a schema-intelligent tool, the agent’s workflow changes:

Discovery phase (no human involved):

  1. Agent calls list_databases — sees what’s indexed
  2. Agent calls schema — understands the graph structure (node labels, edge types)
  3. Agent calls context(table="orders") — gets columns, relationships, cluster membership, lineage

Navigation phase: 4. Agent calls traverse(from_table="orders", to_table="users") — finds join paths 5. Agent calls impact(table="orders", column="customer_id") — checks downstream consequences

Maintenance phase: 6. Agent calls detect_changes — verifies schema hasn’t drifted since last index 7. You run pretensor reindex after migrations — agent picks up changes automatically

The human reviews the agent’s SQL. The agent handles the schema reasoning. That’s the division of labor that scale demands.

When to use which approach

Your situationWhat you need
Tiny schema (< 20 tables), you know it cold, quick one-off queriesSQL Executor
Medium schema, well-constrained FKs, exploratory workMetadata Reader
Medium-to-large schema, production warehouse, multiple databases, AI agent as daily toolSchema-Intelligent
Schema changing frequently, impact analysis needed, cross-DB queriesSchema-Intelligent

Most teams start with a SQL executor (easy setup) and graduate to schema-intelligent tooling when the agent starts making join errors or the schema outgrows what the human can mentally track. The tipping point is usually around 50 tables or when someone says “the agent keeps getting the joins wrong.”

What’s next

The MCP ecosystem is still young — most tools are under a year old. The categories above will blur as SQL executors add metadata tools and metadata readers add relationship discovery. But the core architectural choice — query-based vs. graph-based schema understanding — is structural, not cosmetic. A tool that builds a graph on disk and exposes traversal, impact, and change detection is doing something fundamentally different from a tool that wraps information_schema queries.


Pretensor is open-source (Apache 2.0) on GitHub. Read the quickstart or check the MCP tools reference.