Back to Home
teaguesterling icon

duckdb_mcp

Verified Safe

by teaguesterling

Overview

Integrates DuckDB with the Model Context Protocol (MCP), enabling it to consume resources/tools from external MCP servers and expose its own database capabilities as an MCP server.

Installation

Run Command
./build/release/duckdb -init examples/01-simple/init-mcp-db.sql -f examples/01-simple/start-mcp-server.sql

Environment Variables

  • DUCKDB
  • DB_PATH
  • MEMORY_LIMIT
  • THREADS
  • READ_ONLY
  • ENABLE_EXECUTE
  • DUCKDB_MCP_FOREGROUND
  • allowed_mcp_commands
  • allowed_mcp_urls
  • mcp_server_file
  • mcp_lock_servers
  • mcp_disable_serving
  • mcp_log_level
  • mcp_log_file
  • mcp_console_logging

Security Notes

The extension features a robust security framework, including an allowlist for executable commands (`allowed_mcp_commands`), argument sanitization against shell injection (`..`, `|`, `;`, `&`, backticks, `$`), and immutability of command settings after first use. The `execute` server tool (for DDL/DML) is disabled by default. However, by default, the client-side `ATTACH` command operates in a 'permissive mode' if `allowed_mcp_commands` is not explicitly set, which is a potential risk if deployed without proper configuration. TCP/WebSocket/HTTP transports are noted as 'planned' or 'placeholder' and may not yet have the same level of security vetting as the `stdio` transport.

Similar Servers

Stats

Interest Score40
Security Score8
Cost ClassMedium
Avg Tokens500
Stars18
Forks0
Last Update2025-11-30

Tags

DuckDBMCPData IntegrationAI AgentsProtocol Extension