# mcp-server-duckdb

> MCP Server

This repository provides a Model Context Protocol (MCP) server for DuckDB, enabling database interaction through a unified SQL query tool. It supports querying, table creation, and schema inspection while offering readonly protection.

## Overview

- **Category:** Database
- **Language:** Python
- **Stars:** 178
- **Forks:** 5
- **Owner:** ktanaka101
- **GitHub:** https://github.com/ktanaka101/mcp-server-duckdb
- **Created:** 2024-11-30T14:25:37+00:00
- **Updated:** 2025-03-28T14:58:17+00:00
- **Source:** https://model-context-protocol.com/servers/mcp-server-duckdb-database-interaction-sql

## Setup

## Setup

### Installing via Smithery

To install DuckDB Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-server-duckdb):

```bash
npx -y @smithery/cli install mcp-server-duckdb --client claude
```

### Claude Desktop Integration

Configure the MCP server in Claude Desktop's configuration file:

#### MacOS
Location: `~/Library/Application Support/Claude/claude_desktop_config.json`

#### Windows
Location: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-duckdb",
        "--db-path",
        "~/mcp-server-duckdb/data/data.db"
      ]
    }
  }
}
```

* Note: `~/mcp-server-duckdb/data/data.db` should be replaced with the actual path to the DuckDB database file.

## Tools

## Available Tools

1.  **query** (Execute any SQL query on the DuckDB database; input is a SQL query string, output is query results as text or success message.)
2.  **Configuration with db-path** (Specifies the path to the DuckDB database file, creating it if it doesn't exist.)
3.  **Read-only mode** (Operates the server in read-only mode, preventing write operations and ensuring data integrity.)
