TD

teaguesterling/duckdb_mcp

Developer tools

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

71 stars 8 forks 품질 73 트렌드 20Apache-2.0

teaguesterling/duckdb mcp는 MCP 서버 후보가 https://github.com/teaguesterling/duckdb_mcp.에서 수입됩니다

개요

teaguesterling/duckdb mcp는 MCP 서버 후보가 https://github.com/teaguesterling/duckdb_mcp.에서 수입됩니다

개요(AI 번역)

DuckDB의 모델 Context Protocol (MCP) 확장은 Claude와 같은 SQL 데이터베이스와 AI 조수 간의 원활한 통합을 가능하게 합니다.

특징

  • ** MCP 서버로 실행 **: DuckDB 데이터베이스를 AI 조수에 노출하여 쿼리, 설명 및 데이터를 탐구
  • HTTP Transport: 웹 기반 클라이언트 인증으로 HTTP 서버로 실행
  • **MCP Client로 지정 **: 외부 MCP 서버에 연결하고 SQL을 사용하여 리소스를 쿼리 -Custom Tools: AI Assistant가 발견하고 호출 할 수있는 도구로 매개 변수화 된 SQL 쿼리 -Multiple Formats: JSON, JSONL, Markdown(token-efficient), CSV 또는 일반 텍스트로 출력된 결과

빠른 시작

MCP Server로 (AI Assistants용)

init-server.sql 만들기:

**stdio 수송은 stdout를 소유합니다. ** JSON-RPC는 stdout에 짜맞춰집니다, 그래서 다른 어떤 인쇄든지 수로를 손상시킵니다. 확장자는 다른 작가로부터 멀리 descriptor가 걸립니다. 서버가 시작될 때, 클라이언트는 호스트 출력을 허용한다. handhake (클릭은 -- Loading resources from …] 배너를 인쇄 -init, 플러스 결과표.

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

README

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

DuckDB MCP Extension

A Model Context Protocol (MCP) extension for DuckDB that enables seamless integration between SQL databases and AI assistants like Claude.

Features

  • Run as MCP Server: Expose your DuckDB database to AI assistants with built-in tools for querying, describing, and exploring data
  • HTTP Transport: Run as an HTTP server with authentication for web-based clients
  • Act as MCP Client: Connect to external MCP servers and query their resources using SQL
  • Custom Tools: Publish parameterized SQL queries as tools that AI assistants can discover and call
  • Multiple Formats: Output results as JSON, JSONL, Markdown (token-efficient), CSV, or plain text

Quick Start

As an MCP Server (for AI Assistants)

Create init-server.sql:

LOAD 'duckdb_mcp';

CREATE TABLE products (id INT, name VARCHAR, price DECIMAL(10,2));
INSERT INTO products VALUES (1, 'Widget', 9.99), (2, 'Gadget', 24.99);

PRAGMA mcp_server_start('stdio');

stdio transport owns stdout. JSON-RPC is framed on stdout, so anything else printed there corrupts the channel. The extension takes the descriptor away from other writers when the server starts, and the client tolerates host output that arrives before the handshake (the CLI prints an -- Loading resources from … banner for -init, plus a result table per statement). For a server whose output you cannot afford to have parsed at all, put .output /dev/null as the first line of the init script.

Add to Claude Desktop configuration:

{
  "mcpServers": {
    "my-database": {
      "command": "duckdb",
      "args": ["-init", "/path/to/init-server.sql"]
    }
  }
}

Now Claude can query your database directly!

As an HTTP Server

Run DuckDB as an HTTP server that any HTTP client can connect to:

LOAD 'duckdb_mcp';

-- Start HTTP server with authentication
PRAGMA mcp_server_start('http', 'localhost', 8080, '{"auth_token": "secret"}');

Then connect via HTTP:

# Health check
curl http://localhost:8080/health

# Query with authentication
curl -X POST http://localhost:8080/mcp \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer secret" \
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"query","arguments":{"sql":"SELECT 1"}}}'

As an MCP Client

Windows: MCP client connections are not available — attaching to a server means spawning it over stdio, which is not implemented on Windows (#67). Use WSL. Running DuckDB as an MCP server works on Windows.

LOAD 'duckdb_mcp';

-- Connect to an MCP server
ATTACH 'python3' AS server (TYPE mcp, ARGS '["path/to/server.py"]');
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "my-database": { "command": "duckdb", "args": ["-init", "/path/to/init-server.sql"] } } }