KM

ktanaka101/mcp-server-duckdb

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

179 stars 21 forks 품질 64 트렌드 17MIT

ktanaka101/mcp-server-duckdb는 https://github.com/ktanaka101/mcp-server-duckdb.에서 가져온 MCP 서버 후보입니다.

개요

ktanaka101/mcp-server-duckdb는 https://github.com/ktanaka101/mcp-server-duckdb.에서 가져온 MCP 서버 후보입니다.

개요(AI 번역)

DuckDB용 모델 컨텍스트 프로토콜(MCP) 서버 구현으로, MCP 도구를 통한 데이터베이스 상호작용 기능을 제공합니다. LLM이 분석하는 것도 흥미로울 것 같습니다. DuckDB는 로컬 분석에 적합합니다.

개요

이 서버는 모델 컨텍스트 프로토콜을 통해 DuckDB 데이터베이스와 상호작용할 수 있게 하여 쿼리, 테이블 생성, 스키마 검사와 같은 데이터베이스 작업을 가능하게 합니다.

구성 요소

자료

현재는 맞춤형 리소스가 구현되지 않고 있습니다.

프롬프트

현재는 맞춤형 프롬프트가 구현되어 있지 않습니다.

도구

서버는 다음과 같은 데이터베이스 상호작용 도구를 구현합니다:

  • query: DuckDB 데이터베이스에서 모든 SQL 쿼리를 실행합니다
  • 입력: query (문자열) - 유효한 DuckDB SQL 문장
  • 출력: 텍스트로 결과를 쿼리(또는 CREATE/INSERT와 같은 작업의 성공 메시지)

[! 참고] 서버는 별도의 특수 함수 대신 단일 통합 query 기능을 제공합니다. 현대 LLM은 별도의 엔드포인트 없이도 모든 데이터베이스 연산(SELECT, CREATE TABLE, JOIN 등)에 적합한 SQL을 생성할 수 있기 때문입니다.

[! 참고]

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

mcp-server-duckdb

A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities through MCP tools. It would be interesting to have LLM analyze it. DuckDB is suitable for local analysis.

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

Resources

Currently, no custom resources are implemented.

Prompts

Currently, no custom prompts are implemented.

Tools

The server implements the following database interaction tool:

  • query: Execute any SQL query on the DuckDB database
    • Input: query (string) - Any valid DuckDB SQL statement
    • Output: Query results as text (or success message for operations like CREATE/INSERT)

[!NOTE] The server provides a single unified query function rather than separate specialized functions, as modern LLMs can generate appropriate SQL for any database operation (SELECT, CREATE TABLE, JOIN, etc.) without requiring separate endpoints.

[!NOTE] When the server is running in readonly mode, DuckDB’s native readonly protection is enforced. This ensures that the Language Model (LLM) cannot perform any write operations (CREATE, INSERT, UPDATE, DELETE), maintaining data integrity and preventing unintended changes.

Configuration

Required Parameters

  • db-path (string): Path to the DuckDB database file
    • The server will automatically create the database file and parent directories if they don’t exist
    • If --readonly is specified and the database file doesn’t exist, the server will fail to start with an error

Optional Parameters

  • –readonly: Run server in read-only mode (default: false)
    • Description: When this flag is set, the server operates in read-only mode. This means:
      • The DuckDB database will be opened with read_only=True, preventing any write operations.
      • If the specified database file does not exist, it will not be created.
      • Security Benefit: Prevents the Language Model (LLM) from performing any write operations, ensuring that the database remains unaltered.
    • Reference: For more details on read-only connections in DuckDB, see the DuckDB Python API documentation.
  • –keep-connection: Re-uses a single DuckDB connection mode (default: false)
GitHub에서 전체 README 보기

설치

uvx mcp-server-duckdb --db-path ~/mcp-server-duckdb/data/data.db
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

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