mcp-duckdb mcp

v1.0.0 · MCP Tool · data-analytics · registry.pascalai.org

Run analytical SQL queries over local CSV, Parquet, JSON, Arrow and DuckDB files using DuckDB in-process engine. Ideal for data exploration, aggregations and transformations without a database server.

duckdbsqlanalyticscsvparquetjsonolap

Input Parameters

ParameterTypeDescription
operationrequired string 'query': run SQL; 'describe': stats summary of a file/table; 'sample': return first N rows; 'schema': column types of a file. One of: query, describe, sample, schema.
sqloptional string SQL query. Use read_csv('file.csv'), read_parquet('file.parquet'), read_json('file.json') in FROM clause to query files directly.
fileoptional string Path to a CSV, Parquet, JSON or DuckDB file (used for 'describe', 'sample', 'schema' operations).
limitoptional integer Max rows to return. Default: 100. Default: 100.
formatoptional string Output format. Default: 'rows'. One of: rows, markdown, csv. Default: rows.

Output Fields

FieldTypeDescription
operation string
columns array[string]
rows array[object]
row_count integer
formatted string Result as Markdown table or CSV string (when format != 'rows').
schema array[object] Column definitions with name and type.
stats object Descriptive statistics per column (describe operation).

Examples

Aggregate sales from a Parquet file

// Input
{
  "operation": "query",
  "sql": "SELECT region, SUM(amount) as total FROM read_parquet('/data/sales.parquet') GROUP BY region ORDER BY total DESC"
}

// Output
{
  "operation": "query",
  "row_count": 4,
  "columns": [
    "region",
    "total"
  ],
  "rows": [
    {
      "region": "North",
      "total": 142500.0
    }
  ]
}

Sample first rows of a CSV file

// Input
{
  "operation": "sample",
  "file": "/data/customers.csv",
  "limit": 5
}

// Output
{
  "operation": "sample",
  "row_count": 5,
  "columns": [
    "id",
    "name",
    "country"
  ],
  "rows": []
}

Install & Discovery

Install

ppm install mcp-duckdb

Get JSON Schema

GET /v1/packages/mcp-duckdb/1.0.0/schema

Discover by keyword

GET /v1/mcp/discover?q=duckdb
Discovery hint: Install with ppm install mcp-duckdb or invoke remotely via POST /v1/invoke/mcp-duckdb on the MCP Service.

PascalAI Usage

uses toolslib;
var Tool := LoadTool('mcp-duckdb');
var R := Tool.Call(JsonObj(['operation','query','sql',"SELECT city, COUNT(*) as n FROM read_csv('/data/orders.csv') GROUP BY city ORDER BY n DESC LIMIT 10"]));
Writeln(R['formatted']);