Query your database with AI

Learn how to use the the Model Context Protocol (MCP) to provide AI assistants direct access to your Exasol database.

You can give AI assistants direct access to your Exasol database. Once connected, an assistant can browse your schemas, inspect table structures, and run SQL queries, all within a conversation. You ask questions in plain English, and the assistant translates them into Exasol SQL, executes them, and explains the results.

This works through the Model Context Protocol (MCP), an open standard for connecting AI assistants to external tools and data sources. You run the Exasol MCP Server alongside your database, point your AI client at it, and the assistant gains live database access.

What you can do

With the MCP server connected, your AI assistant can:

  • Explore your database. What schemas exist? Show me the tables in SALES. Describe the CUSTOMERS table.
  • Query your data. What were total sales by region last quarter? Show me the top 10 customers by revenue.
  • Investigate issues. Are there any NULL values in the email column? Which orders have no matching customer record?
  • Generate reports. Break down monthly revenue for 2025, grouped by product category.

The AI assistant writes the SQL, runs it, and presents the results. You can review the generated SQL and refine your question if needed.

Getting started

  1. Install and configure the Exasol MCP Server.

    For the full setup guide see Connect AI assistants (MCP Server).

  2. Ask your first question in your AI client (Claude Desktop, Cursor, or any MCP-compatible tool).

The setup takes a few minutes. You need your Exasol connection details and an MCP-compatible AI client.

Governed SQL (experimental)

The Governed SQL MCP Server is an experimental alternative that uses a local LLM (with Ollama or LM-Studio) for SQL generation. Your schema metadata and queries never leave your machine, and all generated queries are read-only by design.

Use Governed SQL when data sovereignty requirements prevent you from sending schema information to cloud-hosted AI assistants. For most use cases, the standard MCP server is the recommended starting point.

Security

Connecting an AI assistant to your database requires the same care as any other database client. See Security and guardrails for guidance on least-privilege users, credential management, audit logging, and production deployment.

Next steps