Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✓ 8.35s
py 3.11
✕ build_error
✓ 7.8s
py 3.12
✕ build_error
✓ 5.75s
py 3.13
✕ build_error
✓ 6.45s
py 3.9
✕ build_error
✕ build_error
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
run_server
✓ from mcp_server_duckdb.server import run_server
✗ from mcp_server_duckdb import run_server
This quickstart demonstrates how to start the `mcp-server-duckdb` server programmatically and then interact with it using HTTP requests. It creates a simple table, inserts data, and queries it. For persistent databases, specify a file path with `--db-path` when starting the server.
import os
import requests
from subprocess import Popen, PIPE, TimeoutExpired
import time
# Start the server in a separate process
# For simplicity, we use a temporary in-memory database here
# In production, specify a persistent .duckdb file, e.g., --db-path my_database.duckdb
print('Starting mcp-server-duckdb...')
server_process = Popen(['mcp-server-duckdb', '--port', '8001'], stdout=PIPE, stderr=PIPE)
time.sleep(2) # Give the server a moment to start
# Example: Send a query
try:
# Create a table
response = requests.post(
'http://localhost:8001/queries',
json={'query': "CREATE TABLE users (id INTEGER, name VARCHAR);"}
)
response.raise_for_status()
print('CREATE TABLE response:', response.json())
# Insert data
response = requests.post(
'http://localhost:8001/queries',
json={'query': "INSERT INTO users VALUES (1, 'Alice'), (2, 'Bob');"}
)
response.raise_for_status()
print('INSERT INTO response:', response.json())
# Select data
response = requests.post(
'http://localhost:8001/queries',
json={'query': "SELECT * FROM users;"}
)
response.raise_for_status()
print('SELECT * response:', response.json())
except requests.exceptions.RequestException as e:
print(f"Error communicating with server: {e}")
finally:
# Terminate the server process
print('Stopping mcp-server-duckdb...')
server_process.terminate()
try:
stdout, stderr = server_process.communicate(timeout=5)
print('Server stdout:', stdout.decode())
print('Server stderr:', stderr.decode())
except TimeoutExpired:
server_process.kill()
stdout, stderr = server_process.communicate()
print('Server (killed) stdout:', stdout.decode())
print('Server (killed) stderr:', stderr.decode())
Upgrade
Version history
1.1.0latest on PyPI · released May 5, 2025
Audit
Dependencies
duckdbrequiredCore database engine for query execution.
fastapirequiredWeb framework used to build the HTTP server API.
uvicornrequiredASGI server to run the FastAPI application.