SkillAgentSearch skills...

Exasol Labs Text2sql MCP Server

Work with natural language to do SQL queries

Install / Use

/learn @exasol-labs/Exasol Labs Text2sql MCP Server
About this skill

Quality Score

0/100

Supported Platforms

Claude Code
Cursor

README

Exasol MCP Server with Governed SQL option

<p align="center"> <a href="https://opensource.org/licenses/MIT"> <img src="https://img.shields.io/pypi/l/exasol_mcp_server-governed-sql" alt="License"> </a> <a href="https://pypi.org/project/exasol_mcp_server-governed-sql/"> <img src="https://img.shields.io/pypi/dm/exasol_mcp_server-governed-sql" alt="Downloads"> </a> <a href="https://pypi.org/project/exasol_mcp_server-governed-sql/"> <img src="https://img.shields.io/pypi/pyversions/exasol_mcp_server-governed-sql" alt="Supported Python Versions"> </a> <a href="https://pypi.org/project/exasol_mcp_server-governed-sql/"> <img src="https://img.shields.io/pypi/v/exasol_mcp_server-governed-sql" alt="PyPi Package"> </a> </p>

Provides an LLM access to the Exasol database via MCP tools. Includes tools
for reading the database metadata and executing data reading queries, and an
optional tool for (on-premise) translation of natural language into SQL statements
for the Exasol database.

Usually known as Text-to SQL, we call it Governed SQL, as we control every step from
a natural language question to the database answer.

Disclaimer

The accuracy of Large Language Models (LLM) depend on the training set used, and on further
methods like Retrieval Augmented Generation (RAG). Large Language Models can make mistakes and
may produce faulty or wrong results!

Check each result produced by the Text-to-SQL (GovernedSQL) option of this experimental MCP-Server!

To mitigate further security related risks this MCP-Server allows Read-Only queries, only.

Nor Exasol as a company, nor the author(s) of the Text-to-SQL option can be held liable for
damage to any possible kind by using this software. Moreover, the Safe Harbour Statement at the
end of this README shall remain valid.

Do NOT use the MCP-Server with the Text-to-SQL option if you do not agree to these conditions!

This MCP Server is based on the official Exasol MCP Server (https://github.com/exasol/mcp-server) and
extends its functionality by an on-premise Text-to-SQL process. This server does not change the code
of the official server, but hooks into it. The full functionality of the original MCP Server is supported.
Do not install both server, or activate both servers as this will lead into problems.

Version history

Version 1.5.0.2:

  • Password for 'EXA_PASSWORD' will be encrypted now with a tool and decrypted by MCP-Server. Should not be visible in .env file anymore.
  • Changes in README

Version 1.5.0.1:

  • Corrected minimum Python requirements

Version 1.5.0.0:

  • No changes, just following the official Exasol MCP Server!

Version 1.3.0.5:

  • Corrected Password handling (removed old code)

Version 1.3.0.3:

  • Updated README.md file

Version 1.3.0.2:

  • Corrected a bug which prevented "uv tool install" to install successfully.

Version 1.3.0:

  • This MCP server does now fully rely on the official Exasol MCP Server by creating an
    MCP Server object and registering additional tools.
  • New tool: teach the MCP Server with a question and the corresponding SQL statement.
  • Now using the Connection Factory of the official MCP Server
  • Tested for Authentication via OAuth with Keycloak and OpenLDAP.
    See README-OAuth-Authentication.md for details.
  • Recommend Streamable HTTP as standard installation (for Enterprises)
  • IMPORTANT: This MCP Server offers the very same functionality as the official
    Exasol MCP Server. Do not install both servers simultaneously or ensure that one MCP Server is disabled. Otherwise, you may encounter problems.

Version 1.2.1:

  • Architecture Change to use the Hook-Up functionality of the official Exasol MCP-Server
  • Ability to store a predefined question/SQL Statement combination in the underlying
    VectorDB to better adapt to specific user requirements.
  • Environment variable naming changed to adapt better the naming convention of the official MCP-Server

Version 1.0.0:

  • Initial Version.

Introduction

Governed SQL (Text-to-SQL) is nothing unknown or rarely technology anymore. However, most of the
solutions rely on publicly served Large Langauge Models (LLM) by companies like OpenAI, or Anthropic.
This contradicts the principle of Data Sovereignty where your keep full control of your data or metadata. Moving
the transformation of natural language into SQL is not enough, as widely used AI Desktops, e.g.
Anthropic Claude utilize a public served LLM to render the results. To fully protect your data you
have to use an AI Desktop application which allows to use a self-hosted Large Language model.

The MCP sever with the text-to-sql option can be used with commercially AI Desktops like Claude or
open source AI applications like Open-WebUI like Jan.ai.

This README will cover a centralized deployment via streamable http, only!

Refer to the official Exasol MCP Server documentation for other installation options.

Features

  • Checks the relevance of a natural language question for a requested database schema
  • Checks the VectorDB for similar questions and give hints if feasible
  • Transforms the question into an SQL statement
  • Checks if the SQL statement is allowed; currently, we only allow read-only statements.
  • Executes the SQL statement
  • Checks if SQL statement is valid
    • If a result set is returned, the question, the SQL statement, and some metadata is stored in a VectorDB
  • If required, rewrites the question
  • Generates a result

Workflow of the Governed SQL Agent

This is the workflow of the Governed SQL agent, coded with the langgraph library.

<img src="exasol_mcp_server_governed_sql/images/langgraph_workflow.png" width="640" alt=""/>

Prerequisites

  • A dedicated Large Language Model (LLM) server with a LLM of your choice loaded, e.g.:

    • LM-Studio (https://lmstudio.ai) or
    • Ollama (https://ollama.com).

Preferable with GPU support. For accessing the servers the OpenAI API is used. You can use
any other LLM server application which supports the OpenAI API.

Installation

Remark

Do not configure the Exasol supported MCP server and this MCP server at the same time within the
AI tool of your choice. This MCP server will use the same version numbers as the officially
supported Exasol MCP-Server, plus a four digit to show different patches or add-ons.
Equal version numbers indicate the same functionality, plus the Governed-SQL option.

Ensure the uv package is installed. If uncertain call

uv --version

To install uv, please follow the instructions in the uv official documentation.

To install the MCP-Server execute the following command:

uv tool install exasol-mcp-server-governed-sql@latest

You can start the server like:

exasol-mcp-server-governed-sql-http -- host="0.0.0.0" --port=<desired port number>

Optionally, you can specify a dedicated IP address of your server the MCP-Server should listen on.
Before starting, create a ".env" file (if not existing already) and add the environment variables
as shon below. This will start the MCP-Server without authentication. For authentication, please
refer to the README-OAuth-Authentication.md file.

Open-WebUI as end user client

Open-WebUI can be deployed in various options. Please refer to the documentation and install
with you preferred deployment type. Refer to README-OAuth-Authentication for detailed configuration
steps of Open-WebUI for an OAuth Authentication deployment.

Configuration settings

The configuration is split in two parts, one for the Exasol supported MCP-Server, and one
for the text-to-sql option.

Original Settings for the Exasol MCP Server

Most importantly, the server configuration specifies if reading the data using SQL
queries is enabled. Note that reading is disabled by default. To enable the data
reading, the enable_read_query property must be set to true (see the configuration settings json below).

The server configuration settings can also be used to enable/disable or filter the
listing of a particular type of database objects. Similar settings are defined for
the following object types:

schemas,
tables,
views,
functions,
scripts

The settings include the following properties:

  • enable: a boolean flag that enables or disables the listing.
  • like_pattern: filters the output by applying the specified SQL LIKE condition to the object name.
  • regexp_pattern: filters the output by matching the object name with the specified regular expression.

The settings can be specified using another environment variable - EXA_MCP_SETTINGS.
They should be written in the json format. The json text can be set directly as a
value of the environment variable, for example

{"EXA_MCP_SETTINGS": "{\"schemas\": {\"like_pattern\": \"my_schemas\"}"}

Note that double quotes in the json text must be escaped, otherwise the environment
variable value will be interpreted, not as a text, but as a part of the outer json.

Alternatively, the settings can be written in a json file. In this case, the
EXA_MCP_SETTINGS should contain the path to this file, e.g.

{"EXA_MCP_SETTINGS": "path_to_settings.json"}

The following json shows the default configuration settings.

{
  "schemas": {
    "enable": true,
    "like_pattern": "",
    "regexp_pattern": ""
  },
  "tables": {
    "enable": true,
    "like_pattern": "",
    "regexp_pattern": ""
  },
  "views": {
    "enable": false,
    "like_pattern": "",
    "regexp_pattern": ""
  },
  "functions": {
    "enable": true,
    "like_pattern": "",
    "regexp_pattern": ""
  },
  "scripts": {
    "enable": true,
    
View on GitHub
GitHub Stars3
CategoryDevelopment
Updated10d ago
Forks1

Languages

Python

Security Score

90/100

Audited on Mar 13, 2026

No findings