File size: 2,642 Bytes
c555a85
 
 
 
 
 
 
 
 
8129e7b
 
26dfc7a
c555a85
 
 
ca9d4fb
 
 
 
 
26dfc7a
ca9d4fb
 
 
 
 
 
 
 
 
 
 
 
4611b31
 
 
ca9d4fb
 
 
4611b31
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: Mcp Data Analyst
emoji: πŸ‘
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
tags:
  - mcp-server-track
  - agent-demo-track
short_description: Connect to more than 20 datasource and ask question
---


# Ibiza Server

Ibiza Server is a lightweight MCP server designed for **natural language question answering** over multiple SQL-compatible databases or files sources like csv or parquet. It empowers users to ask questions in plain English (or any supported language), then generates safe and optimized SQL queries using large language models and reranking techniques.

I have made this for the Agent-MCP-Hackathon in the track : mcp-server-track and also the agent-demo-track as the space can be considered by an agent you can interact with

A huge thanks to the **Modal** team for providing compute credits that enabled me to deploy two essential services for Ibiza:

  - A reranking API powered by Qwen3-Reranker-4B, used to identify the most relevant tables based on the user’s question.

  - A SQL generation service using Qwen3-14B with vLLM, which generates validated SQL queries and natural language explanations.

## ✨ Key Features

- πŸ”Œ **Multi-database compatibility**: Connects to MySQL, PostgreSQL, SQLite, Snowflake, and more via [Ibis](https://ibis-project.org/).
- 🧠 **AI-powered SQL generation** using **Qwen3-14B** via a custom VLLM inference server.
- πŸ›‘οΈ **SQL validation and transpilation** using [SQLGlot](https://github.com/tobymao/sqlglot).
- πŸ“Š **Table relevance reranking** with **Qwen3-Reranker-4B** Via a dedicated re-ranking API, the re-ranking mode is enabled only for databases with more than three tables, but this parameter can be modified.
- πŸ” **Self-Correction** If an error occurs during SQL query validation (e.g., mismatch with the database schema or runtime failure), the agent enters a self-correction mode.  In this mode, it analyzes previous attempts and error messages to generate a corrected SQL query automatically.
- πŸ—£οΈ **Natural language answers** returned alongside query results , this mode is enabled in the HF space but not in the MCP server, which allows the client's MCP LLM to generate the final answer based on the returned data."

## Demo

- With an online **PostgreSQL** database with CLINE MCP Client : https://www.youtube.com/watch?v=CC9Z1wHNDPA
- With an online **CSV** dataset With CLINE : https://www.youtube.com/watch?v=XiOmvVkuesg
- With an online **PostgreSQL** database in the HF space : https://youtu.be/R39H7LRxj3Y
- With a local **CSV** dataset in the HF space : https://youtu.be/4qet7YJ5P5Q