# QuestDB (Time-Series) MCP

> QuestDB connects your AI agent directly to a high-performance time-series database, letting you run complex data queries using natural language. It handles everything from real-time metrics analysis and bulk data ingestion to exporting massive datasets in CSV or Parquet format.

## Overview
- **Category:** databases
- **Price:** Free
- **Tags:** time-series, sql, data-ingestion, real-time-analytics, questdb

## Description

You can treat your database like an extension of your conversation. Instead of writing boilerplate SQL, simply ask your agent for the average temperature over the last hour or check what happened to a metric two weeks ago. This MCP lets you run complex queries and manage time-series data—whether it's sensor readings, stock prices, or server logs—all through natural language commands. You can also import large amounts of raw data, which automatically builds the necessary tables and schema for you. If your agent needs to extract results for a report, it exports everything cleanly as CSV or Parquet files. Vinkius hosts this MCP, making high-speed time-series analysis available from any compatible client.

## Tools

### execute_sql
Use this to run any standard SQL operation, like querying specific metrics or making schema changes (DDL/DML).

### export_data
Extracts the results from a query and packages them for easy download as CSV or Parquet files.

### import_data
Feeds in new data from CSV or TSV, automatically setting up the necessary tables and columns if they don't exist yet.

### ping
Confirms the database server is operational and returns its current version number.

## Prompt Examples

**Prompt:** 
```
Check if the QuestDB server is online and show me the version.
```

**Response:** 
```
I've pinged the server. It is currently online and running QuestDB version 8.1.0.
```

**Prompt:** 
```
Execute a query to find the average temperature from the 'sensors' table for the last hour.
```

**Response:** 
```
Executing SQL... The average temperature for the last hour is 22.5°C based on 1,200 data points in the 'sensors' table.
```

**Prompt:** 
```
Export the last 1000 rows of the 'trades' table as a CSV file.
```

**Response:** 
```
I've initiated the data export. You can now download the CSV containing the last 1000 trade records.
```

## Capabilities

### Run complex database queries
The agent executes standard SELECT, INSERT, and DDL statements to query or modify data in the QuestDB instance.

### Bulk import structured data
You can feed tabular files like CSV or TSV directly into tables; the MCP automatically figures out which columns are needed.

### Extract large result sets
It pulls query results and exports them immediately as ready-to-use CSV or Parquet files for external analysis.

### Check database health
The agent runs a quick check to confirm the server is online and reports its current version number.

## Use Cases

### Finding the average server load for last quarter
A DevOps engineer needs to know the quarterly trend of CPU usage. They ask their agent, which uses `execute_sql` to run a time-series query and returns the specific average metric, eliminating the need to dive into multiple dashboard tabs.

### Onboarding new sensor data streams
An analyst receives a large batch of raw temperature readings in a CSV. Instead of manually writing schema creation scripts, they use `import_data` and simply upload the file; the MCP builds the table structure automatically.

### Preparing data for an external report
A product manager asks their agent to pull the top 10 most active users from a specific period. The agent uses `execute_sql` and then calls `export_data`, giving the PM a clean CSV file they can immediately attach to a presentation.

### Checking database connectivity during an incident
When the application goes down, a support technician first runs the `ping` tool. The agent confirms the server status and version instantly, isolating whether the problem is connectivity or a logic bug.

## Benefits

- Stop writing boilerplate SQL. Instead of crafting a complex query for every metric you need, just ask your agent to run the SELECT statement using `execute_sql`. You get the data instantly.
- Handling massive datasets is easy. Use `import_data` to drop CSV or TSV files into the database. The MCP handles schema creation and partitioning automatically, so you don't have to pre-process anything.
- Reporting shouldn't require manual exports. After running a query with `execute_sql`, use `export_data` to get your results as clean CSV or Parquet files ready for sharing.
- Know if the database is healthy before you start. Running the `ping` tool gives you instant server status and version confirmation, letting you verify operational status in seconds.
- The whole process feels seamless. You keep everything within your chat interface—from querying data to exporting it—without ever opening a separate SQL client.

## How It Works

The bottom line is you get high-speed access to complex time-series functions without ever leaving your natural language interface.

1. First, subscribe to this MCP on Vinkius and provide your specific QuestDB connection URL along with any necessary authentication credentials.
2. Next, direct your agent to perform a task—for instance, asking it to find the average CPU utilization for last month or import a new batch of sensor readings.
3. The system executes the required operation against the database and returns the actionable result, whether that's a data table, an exported file link, or a simple status message.

## Frequently Asked Questions

**How do I connect QuestDB (Time-Series) MCP using the `ping` tool?**
You just ask your agent to check the status. The agent automatically runs the `ping` function, which confirms if the database is online and reports its current version number for you.

**Can QuestDB (Time-Series) MCP handle data I don't have a schema for?**
Yes. Use the `import_data` tool. You upload your CSV or TSV file, and the MCP automatically detects and creates the necessary tables and columns before ingestion.

**What is the best way to get data out of QuestDB (Time-Series) MCP?**
For reporting, use `export_data`. It takes your query results and packages them into professional CSV or Parquet files that are ready for any external analysis tool.

**Does the `execute_sql` tool support complex joins?**
Yes. Since it executes standard SQL, you can run full DML/DDL operations and perform complex joins across different tables within your time-series data.

**Is QuestDB (Time-Series) MCP only for monitoring logs?**
No. While great for logs, it handles any metric that changes over time—think stock prices, sensor readings, or server usage counts—as long as the data is structured by time.