Design Engineer Logo
Visit Repo
Open Graph preview

MCP Server Duckdb

A Model Context Protocol (MCP) server implementation for DuckDB

Site favicon
🗄️ Data

Overview

mcp-server-duckdb

Description:
A DuckDB server implementation enabling database operations through protocol tools.

Category: Database Tools

Overview:
This server provides a bridge to interact with DuckDB databases through standardized tools for querying, table management, and schema inspection. It features both read and write capabilities with an optional readonly mode for enhanced security.

Key Features:

  • Execute SELECT queries for data retrieval
  • Perform INSERT, UPDATE, DELETE operations (when not in readonly mode)
  • Create and manage tables
  • List available tables and inspect schema information
  • Automatic database file creation
  • Configurable readonly mode for data protection

Tools:

  • read-query: Execute SELECT statements
  • write-query: Perform data modifications
  • create-table: Create new database tables
  • list-tables: View all database tables
  • describe-table: Get table schema details

Installation & Setup:

npx @modelcontextprotocol/inspector

Configuration Example:

{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": ["mcp-server-duckdb", "--db-path", "~/mcp-server-duckdb/data/data.db"],
      "env": {
        "DB_PATH": "~/path/to/database.db"
      }
    }
  }
}

Required Parameters:

  • db-path: Database file location
  • Optional: --readonly flag for read-only mode

Development Requirements:

  • Python with uv package manager
  • DuckDB Python package
  • MCP server dependencies