ktanaka101_mcp-server-duckdb

ktanaka101_mcp-server-duckdb

0

This project is an MCP server for DuckDB, enabling database interactions such as querying and schema inspection via the Model Context Protocol. It supports operations like reading, writing, and table management while offering a read-only mode to ensure data integrity. Suitable for integration with platforms like Claude Desktop.

Overview

This server enables interaction with a DuckDB database through the Model Context Protocol, allowing for database operations like querying, table creation, and schema inspection.

Components

Tools

The server implements the following database interaction tools:

  • read-query: Execute SELECT queries to read data from the database.
  • write-query: Execute INSERT, UPDATE, or DELETE queries to modify data.
  • create-table: Create new tables in the database.
  • list-tables: List all tables in the database.
  • describe-table: Get schema information for a specific table.

Note: When the server is running in readonly mode, write-query and create-table are disabled to maintain data integrity.

Configuration

Required Parameters

  • db-path: Path to the DuckDB database file.

Optional Parameters

  • --readonly: Run server in read-only mode to prevent any write operations.

Installation

Installing via Smithery

To install DuckDB Server for Claude Desktop automatically via Smithery: 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

Development

Prerequisites

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

Debugging

Debugging MCP servers can be challenging. Use the MCP Inspector for the best debugging experience.