# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.0] - 2026-07-03

The "Onager era" release: optional native graph analytics + deep documentation overhaul.

### Added

- **Optional Onager extension loading** — set `ENABLE_ONAGER=true` (with `ALLOW_UNSIGNED_EXTENSIONS=true`) and `DuckDBService.initialize()` installs + loads the [Onager](https://github.com/CogitatorTech/onager) community extension: ~65 native graph table functions (centrality incl. betweenness/katz/closeness/voterank, community incl. louvain/infomap, dijkstra/bellman-ford/floyd-warshall, link prediction incl. adamic-adar/jaccard, graph metrics, MST, ego/k-hop subgraphs, parallel variants, generators) callable directly on edge tables without `CREATE PROPERTY GRAPH`.
  - Opt-IN (unlike DuckPGQ, which is opt-out) because Onager is alpha (`0.1.0-alpha.6`): node ids must be BIGINT, some functions require named parameters (`source = 1`), no builds for `osx_amd64` / `windows_amd64_mingw` / WASM.
  - New `DuckDBService.onagerLoaded` getter for runtime capability checks.
  - `ONAGER_STRICT_MODE=true` to throw instead of warn on load failure.
  - Graceful degradation guaranteed: load failure never breaks the service (4 dedicated tests).

### Documentation overhaul

- **README**: new Onager section (function-family table, validated SQL examples, alpha caveats); DuckLake tools renamed "DuckLake-style Snapshots" with an honesty note (they are a self-contained emulation, not the official `ducklake` extension — link to the real one for lakehouse concurrency); **MotherDuck note refreshed** — MotherDuck now supports DuckDB clients up to **1.5.4** (July 2026), so the `motherduck.*` tools are inside the supported window again; env-vars table completed (`ENABLE_ONAGER`, `ONAGER_STRICT_MODE`).
- **CLAUDE.md**: project status brought current (was still describing v1.1.0/469 tests).
- Capability report: Onager T7.5 section rewritten with validated examples.

### Compatibility

- 514 tests pass (was 510), +4 for Onager loading.
- Additive only: new env vars are off by default; no behavior change without opt-in.

## [1.5.0] - 2026-07-03

Unlocks the DuckDB engine upgrade that had been blocked for ~4 months by DuckPGQ.

### Upgraded

- **DuckDB 1.5.0 → 1.5.4**: `@duckdb/node-api` bumped `1.5.0-r.1` → `1.5.4-r.1`.
- **DuckPGQ**: community binary `aec2e25` (1.5.0) → `f386a6cf` (1.5.4).

### Why the jump straight to 1.5.4

DuckPGQ had **no working community binary** for DuckDB 1.5.1, 1.5.2 or 1.5.3:

- 1.5.1 binary SIGSEGVs on `LOAD` (cwida/duckpgq-extension#305 / #307 — root cause: `EXTENSION_STATIC_BUILD` ABI issue in `ExtensionCallbackManager::Register`).
- 1.5.2 / 1.5.3 were never built on the CDN (404).

The maintainer shipped a working 1.5.4 build on 2026-06-30 (incorporating the OpenSSL-dependency removal from #307). This package therefore skips 1.5.1–1.5.3 entirely.

### Validation

- **510 tests pass on DuckDB 1.5.4, zero regressions.**
- **DuckPGQ capability report re-run: 15/20 ✅ — identical to 1.5.0.** The 5 ❌ are unchanged known limitations / intentional safety guards (ALL SHORTEST not implemented, WHERE in bounded patterns, standalone Kleene guard, anonymous-edge binding, Onager BIGINT requirement).
- **Onager** (`onager_pagerank`) is now _present_ on 1.5.4 (was absent on 1.5.1) — requires BIGINT src/dst columns.
- GEOMETRY + CRS + GeoParquet integration confirmed working on 1.5.4 (picks up 1.5.4's native geometry Parquet stats pruning + GeoArrow CRS fixes).

### Downstream impact

The bump lifts the version wall documented in the deposium plugin-usage audit §F:

- Real **DuckLake** extension (needs DuckDB ≥1.5.2) is now reachable for multi-reader/writer.
- **Quack** remote protocol (needs ≥1.5.3) becomes technically loadable (still evaluated as not-a-fit — see audit §I).

## [1.4.0] - 2026-04-27

Closes the audit (`DUCKDB-MCP-NODE-AUDIT-2026-04-26`) by shipping the two items that were deferred from v1.3.0. Additive only — no breaking changes.

### Added

- **`GraphError` class with structured `code` enum** — graph handlers now throw `GraphError` (extends `Error`) carrying `.code: 'NO_NODES' | 'NO_EDGES' | 'INVALID_FILTER' | 'INVALID_INPUT' | 'NO_PATH' | 'TIMEOUT' | 'INFRA'` instead of raw `Error`. Hosts can route fallbacks by inspecting `.code` rather than grepping error messages. Backward compatible because `GraphError instanceof Error` and `.message` is preserved.
  - `validateGraphTables` classifies DuckDB Binder/Catalog/Parser errors against a user-supplied `filter` as `INVALID_FILTER`; everything else stays `INFRA`.
  - `GraphError.fromUnknown(error, { context: 'filter' | 'query' })` is the static helper handlers use; safe to call on a value already wrapped (no-op).
- **`ComputeSession.metrics()`** — sessions opened via `openComputeSession` now expose a `metrics()` method returning `{queries_run, total_duration_ms, last_query_at, errors_count}`. Returns a defensive copy. Hosts can inspect a session's lifetime without instrumenting their service. Passthrough sessions (already wrapped) keep their existing metrics object.

### Changed

- All graph handlers (`handlePageRank`, `handleEigenvector`, `handleCommunityDetect`, `handleModularity`, `handleWeightedPath`, `handleTemporalFilter`, `handleComparePeriods`, `handleGraphExport`) wrap their `catch` errors in `GraphError.fromUnknown(error)` before re-throwing.

### Compatibility

- 510 tests pass (was 491), +19 dedicated to v1.4.0.
- Type-only additions to public API: `GraphError`, `GraphErrorCode`, `SessionMetrics`.
- `instanceof Error` checks keep working — `GraphError` is a subclass.
- Existing `error.message`-based code keeps working unchanged.

## [1.3.0] - 2026-04-26

Audit-driven quickwins from [DUCKDB-MCP-NODE-AUDIT-2026-04-26](../docs/2026/handoffs/) (deposium side). Three additive items, no breaking changes.

### Added

- **Graph helper utilities** — exposed via main entry point so host runtimes can build their own custom centrality / pathing queries without duplicating the dedup-safe subquery logic. New exports:
  - `validateGraphTables`, `buildNodeSubquery`, `buildEdgeSubquery`, `getColumnRefs`
  - `tempTablePrefix`, `dropTempTable`, `cleanupTempTables`
  - Type exports: `ValidateGraphTablesOptions`, `ValidateGraphTablesResult`
- **Discovery API** — new `AVAILABLE_OPS` constant lists every graph + process op shipped by the plugin with `name`, `family`, `description`, `costClass`, `inputs`. Lets host runtimes boot-validate their op-to-model bindings against what is actually available, avoiding silent drift.
- **`topNodesPreview` opt-in** — `validateGraphTables` accepts a third argument `{ previewNodes?: number }`. When set, the returned object includes `topNodesPreview: Array<string|number>` (DISTINCT node ids, capped at 100). No extra query for default-path callers.
- **Entry/exit logs on every graph handler** — `handlePageRank`, `handleEigenvector`, `handleCommunityDetect`, `handleModularity`, `handleWeightedPath`, `handleTemporalFilter`, `handleComparePeriods` now emit:
  - `debug` log on entry with `{nodes, edges, distinct_node_count, ...op-specific-params}`
  - `debug` log on exit with `{...key-result-stats, duration_ms}`
  - `error` log on failure now includes `duration_ms`
    Stats only — never the full data payload. Decisive for diagnosing host-side issues without re-instrumenting call sites.

### Compatibility

- 477 tests pass (was 469), zero regressions
- Backward compatible: all new exports are additive, `validateGraphTables` signature widened with optional third parameter

## [1.1.0] - 2026-03-12

### Upgraded

- **DuckDB 1.5.0 "Variegata"**: `@duckdb/node-api` upgraded from `1.4.1-r.5` to `1.5.0-r.1`
- **DuckPGQ**: Community extension confirmed working on DuckDB 1.5.0 (version `aec2e25`, was `7705c5c` on 1.4.x)
- All 469 tests pass on DuckDB 1.5.0, zero regressions

### DuckPGQ Feature Status on 1.5.0

- ✅ Fixed-length paths, bounded quantifiers `{n,m}`, ANY SHORTEST
- ❌ Standalone Kleene `->*`/`->+` still intentionally blocked (infinite result safety)
- ❌ Anonymous edges still require variable binding

## [1.0.0] - 2026-02-22

### Features — MCP SDK 1.26.0 + HITL (S3)

- **HITL elicitation**: Production mode now uses MCP elicitation API to ask user confirmation before executing destructive SQL (DROP, DELETE, ALTER, TRUNCATE, etc.) instead of hard-blocking
- **connect() guard**: `start()` checks `server.transport` before calling `connect()` to prevent SDK 1.26.0 double-connect errors
- **MCP SDK pinned** to `^1.26.0` (was `^1.24.3`)
- Elicitation fallback: if client doesn't support elicitation, destructive queries are blocked (safe default)
- `MCP_ELICIT_TIMEOUT` env var controls elicitation timeout (default 30s)

### Features — Graph Algorithm MCP Tools (S2: F1-F5)

8 new graph algorithm tools accessible via MCP, using iterative SQL with temp tables (DuckPGQ workaround for DuckDB 1.4.x):

- **`graph.pagerank`** — Iterative PageRank centrality with configurable damping factor and iterations
- **`graph.eigenvector`** — Power iteration eigenvector centrality (undirected adjacency)
- **`graph.community_detect`** — Label propagation community detection with convergence check
- **`graph.modularity`** — Modularity score Q for community structure quality (auto-detects communities if needed)
- **`graph.weighted_path`** — Weighted path finding in 3 modes: strongest (multiplicative), cheapest (Bellman-Ford), combined (additive)
- **`graph.temporal_filter`** — Filter graph by time period, return node/edge counts, avg weight, density
- **`graph.compare_periods`** — Compare two periods: classify edges as NEW/REMOVED/STRENGTHENED/WEAKENED/STABLE
- **`graph.export`** — Export graph in 5 formats: JSON, CSV (Gephi), D3, GraphML, Parquet

### Bug Fixes — Test Stabilization (S1)

- 422/422 tests green, ESM class-based mocks, transport mock rewrite, federation + context alignment

### Package

- New `@seed-ship/duckdb-mcp-native/graph` subpath export
- All graph types exported from main entry point
- 469 tests passing (28 new HITL + 19 graph), 0 failures

### Technical Notes

- All graph algorithms use iterative SQL with temp tables — **no recursive CTEs** (segfault risk on DuckDB 1.4.x)
- `validateQuery()` method preserved for backward compatibility
- HTTP transport clarified as client-side only (distinct from SDK's server-side `StreamableHTTPServerTransport`)

## [0.7.1] - 2025-10-19

### ⬆️ Updated

- **@duckdb/node-api**: Upgraded from `1.4.1-r.1` to `1.4.1-r.4` (latest release)
  - Latest bug fixes and performance improvements from DuckDB team
  - Published 21 hours ago via GitHub Actions

### 📚 Documentation

- Updated README to reflect Production Ready status (v0.7.1)
- Changed release status from "Release Candidate v0.6.8-rc.2" to "Production Ready v0.7.1"

### 🔍 Investigation

- HTTP transport client reviewed (distinct from HTTP server transport)
- Confirmed HTTP client initialization works as designed
- No breaking changes from DuckPGQ support (v0.7.0)

## [0.7.0] - 2025-10-19

### 🎯 Features

- **DuckPGQ Extension Support**: Integrated DuckDB Property Graph Query extension
  - Automatic loading of `duckpgq` extension from community repository
  - SQL:2023 Property Graphs standard compliance
  - Enabled when `allowUnsignedExtensions: true` in configuration
  - Supports Kleene operators (`*`, `+`), bounded quantifiers (`{n,m}`)
  - `ANY SHORTEST` path queries for optimal graph traversal
  - Full `GRAPH_TABLE` syntax support for advanced pattern matching

### ⚠️ Compatibility Notes

- **DuckPGQ Availability**:
  - ✅ Fully functional with DuckDB v1.0.0 - v1.2.2
  - 🚧 Binaries for DuckDB v1.4.x are in active development (as of 2025-10-19)
  - Infrastructure is ready and will auto-enable when binaries are published
  - Track progress: [cwida/duckpgq-extension](https://github.com/cwida/duckpgq-extension)

- **Current Behavior with DuckDB 1.4.x**:
  - Extension load attempt returns HTTP 404 (expected)
  - Informational message logged (not error/warning)
  - Database continues to function normally for non-graph queries
  - Set `ENABLE_DUCKPGQ=false` to suppress info messages

### 🔧 Configuration

- **Graph Features Toggle**: Graph capabilities activated via `allowUnsignedExtensions` config
  - Graceful degradation if extension unavailable
  - Non-blocking initialization (continues without graph features if load fails)
  - Clear logging for extension load status
  - New env var: `ENABLE_DUCKPGQ=false` to skip load attempt entirely

### 📚 Documentation

- Added comprehensive DuckPGQ section in README with compatibility matrix
- Inline documentation for DuckPGQ feature support and version compatibility
- Example SQL queries for Property Graph operations
- Clarified property graph capabilities in service initialization

### 🛠️ Technical Details

- Extension loaded via: `INSTALL duckpgq FROM community; LOAD duckpgq;`
- Uses DuckDB 1.4.1-r.1 via `@duckdb/node-api ^1.4.1-r.1`
- Foundation for advanced knowledge graph queries in dependent packages
- Improved error handling with HTTP 404 detection for missing binaries

## [0.6.8-rc.2] - 2025-10-05

### 📦 Dependencies

- **@duckdb/node-api**: Updated to 1.4.0-r.2 (CRITICAL SECURITY UPDATE)
  - Protection against malware in compromised version 1.3.3
  - LTS support until September 2026
  - New features: AES-256 database encryption, MERGE INTO, Apache Iceberg support
  - Performance improvements: k-way merge sorting, materialized CTEs

- **@modelcontextprotocol/sdk**: Updated to 1.19.1
  - OAuth 2.0 support for enhanced MCP server authentication
  - Structured JSON tool output for typed responses
  - User input elicitation during sessions
  - Security fixes: token binding, PKCE implementation

- **winston**: Updated to 3.18.3
  - Fixed formatting bugs with logform 2.7.0
  - Improved log quality and stability

### 🛡️ Security

- **Zero vulnerabilities** confirmed via npm audit
- All critical security updates applied
- Following DuckDB r.2 revision nomenclature

### ✅ Validation

- All DuckDB tests passing (9/9)
- All MCP server tests passing (4/4)
- Build successful with updated dependencies
- Security audit clean

## [0.6.8-rc.1] - 2025-01-24

### 🛡️ Security

- **SQL Injection Prevention**: Added comprehensive SQL escaping
  - All dynamic SQL now uses `escapeIdentifier()` and `escapeFilePath()`
  - Protected temp table creation in QueryRouter
  - Secured all file path operations
- **Server Authentication**: New authentication system for MCP server attachments
  - Added `server-auth.config.ts` with allowlist/blocklist functionality
  - Environment variable configuration for allowed servers
  - Protection against malicious server connections
- **Path Traversal Prevention**: Enhanced security for file operations
  - Using `crypto.randomBytes()` for unpredictable temp file names
  - Path validation to prevent directory traversal attacks
  - Secure file extension validation in CacheManager
- **Configuration Security**: Removed hardcoded endpoints
  - VirtualFilesystem now uses environment configuration
  - Configurable connection patterns via `MCP_CONNECTION_PATTERNS`
  - Secure defaults (stdio only unless explicitly enabled)

### Added

- **Greptile Integration**: Automated code analysis
  - GitHub Action for automatic security scanning on PRs
  - PR template with Greptile instructions
  - Comprehensive security analysis workflow

### Fixed

- Fixed misleading SQL examples in tool descriptions
- Updated tests to match new secure SQL escaping format
- Corrected ResourceRegistry mock to prevent false positives in tests

### Changed

- **Release Candidate**: Moving to RC phase for production testing
- Enhanced test coverage for security features
- Improved error messages for authentication failures

## [0.6.7] - 2025-01-21

### Testing

- Test release to verify Greptile code analysis integration
- No functional changes

## [0.6.6] - 2025-01-21

### Changed

- Documentation improvements and Beta status announcement
- Enhanced README with comprehensive Federation examples
- Updated project status from Alpha to Beta
- Improved test coverage documentation (~70%)

### Documentation

- Added detailed Federation query examples in README
- Updated tool count to reflect new federate_query tool
- Added monitoring to list of working features
- Clarified Beta readiness for testing

## [0.6.5] - 2025-01-21

### Added

- **Federation Activation**: Distributed query execution across multiple MCP servers
  - `FederationManager` class to orchestrate all federation components
  - `federate_query` MCP tool with full `mcp://` protocol support
  - Automatic server registration when using `attach_mcp`
  - Support for cross-source JOINs and aggregations
  - Query planning and execution with QueryRouter
  - Resource discovery across all connected servers
  - Connection pooling with automatic reconnection
- **Federation Examples**: Comprehensive examples demonstrating:
  - Single-source federated queries
  - Multi-source JOINs between local and remote data
  - Cross-source aggregations with UNION queries
  - Performance optimization patterns
- **Federation Integration**: Seamless integration with existing features
  - Works with Virtual Filesystem for transparent access
  - Compatible with DuckLake time travel
  - Supports MotherDuck cloud queries

### Changed

- **Project Status**: Upgraded from Alpha (15% coverage) to Beta
- Enhanced `attach_mcp` tool to automatically register servers with federation
- MCP server now initializes FederationManager on startup

### Internal

- Created `src/federation/index.ts` as central federation module
- Added helper functions for quick federation setup
- Federation components now fully integrated and activated

## [0.6.4] - 2025-01-21

### Added

- **File-based Monitoring System**: Complete performance monitoring without external dependencies
  - MetricsCollector with automatic JSON log rotation (7-day retention)
  - Query performance tracking with slow query detection (>1000ms)
  - Memory usage monitoring with alerts at 3GB and 3.5GB thresholds
  - Connection pool hit/miss rate tracking (alert < 80%)
  - Cache effectiveness monitoring for mcp:// URIs (alert < 60%)
  - CLI metrics viewer with visual indicators (✅ ⚠️ 🚨)
  - Performance percentiles (P50, P95, P99) for query analysis
- **Monitoring Integration**: Hooked into core components
  - DuckDBService: Query timing and row count tracking
  - ConnectionPool: Hit/miss statistics collection
  - CacheManager: Cache effectiveness metrics
  - MCP Server: Automatic metrics initialization
- **Monitoring Tests**: Comprehensive test suite (30 tests, 87% coverage)

### Changed

- Enhanced DuckDBService with performance.now() timing
- ConnectionPool now reports detailed statistics
- CacheManager tracks hit/miss rates

### Internal

- Added MetricsCollector singleton with configurable flush intervals
- Metrics stored in `logs/metrics/` with daily rotation
- Documentation added to `/doc-internal/MONITORING.md`

## [0.6.3] - 2025-01-21

### Added

- **Comprehensive Test Coverage**: Increased from 20% to ~70% (300+ tests total)
  - SpaceContext tests: Multi-tenant isolation, query transformation, DuckLake integration
  - ResourceRegistry tests: Federation namespace management, URI resolution, glob patterns
  - ConnectionPool tests: Transport auto-negotiation, health checks, TTL management, LRU eviction
  - QueryRouter tests: Federated query analysis, execution, streaming, error handling
  - VirtualFilesystem enhanced tests: Glob patterns, batch operations, auto-discovery, format detection
  - Protocol transport tests: WebSocket, TCP, HTTP with long polling, SDK adapter
- **Test Infrastructure**: Improved mocking and isolation for better test stability

### Internal

- Hidden Space Context system fully tested (multi-tenant isolation ready for DEPOSIUM)
- Federation architecture validated with comprehensive test coverage
- SLM preparation hooks tested and ready for activation
- All critical components now have 70%+ test coverage

## [0.6.2] - 2025-01-21

### Added

- **Federation Documentation**: Comprehensive federation patterns guide
- **Roadmap Update**: Strategic roadmap distinguishing DuckDB MCP vs DEPOSIUM features
- **Hidden Features Discovery**: Documented internally that most advanced features are already implemented

### Changed

- **Documentation Structure**: Updated ARCHITECTURE.md and ROADMAP.md with implementation status
- **Feature Checkboxes**: Marked completed features (transports, MotherDuck, Virtual Filesystem, etc.)

### Internal

- Space Context System remains hidden but fully functional
- Federation components (ResourceRegistry, ConnectionPool, QueryRouter) ready for activation
- SLM integration hooks prepared for Q2 2025

## [0.6.1] - 2025-01-21

### Fixed

- **VirtualFilesystem URI Handling**:
  - Fixed URIParser to allow `*` as valid server name for glob patterns
  - Improved isGlob detection to include server wildcards
  - Fixed VirtualFilesystem to handle MCP SDK response format with contents array
  - Fixed test resource registrations to use URIs without leading slashes
  - Proper error messages for unresolvable `mcp://` URIs

### Testing

- All 171 tests now passing (up from 111)
- Fixed VirtualFilesystem test suite completely
- Test coverage increased to 20%

## [0.6.0] - 2025-01-21

### Added

- **Virtual Filesystem (mcp:// Protocol)**: Direct SQL access to MCP resources without manual setup
  - `URIParser` - Parse and validate mcp:// URIs with glob support
  - `CacheManager` - Intelligent local caching with TTL and LRU eviction
  - `FormatDetector` - Auto-detect CSV, JSON, Parquet, Arrow, Excel formats
  - `QueryPreprocessor` - Transform SQL queries with mcp:// URIs
  - `VirtualFilesystem` - Main orchestrator for transparent resource access
- **Zero Configuration Access**: Query MCP resources directly in SQL
  ```sql
  SELECT * FROM 'mcp://weather-server/forecast.csv'
  ```
- **Glob Pattern Support**: Query multiple resources with wildcards
  ```sql
  SELECT * FROM 'mcp://*/logs/*.json'
  ```
- **DuckDB Integration**: New `executeQueryWithVFS()` method for transparent query execution
- **Auto-Discovery**: Automatically connect to MCP servers when referenced
- **Format Detection**: Automatic detection from extension, content-type, or magic numbers
- **Comprehensive Tests**: Full test coverage for Virtual Filesystem components

### Infrastructure

- Created `filesystem/` module with all VFS components
- Extended `DuckDBService` with Virtual Filesystem support
- Added configuration options for enabling VFS

## [0.5.1] - 2025-01-21

### Documentation

- Added compatibility note for MotherDuck (requires DuckDB v1.3.2, currently using v1.4.0)

## [0.5.0] - 2025-01-21

### Added

- **MotherDuck Cloud Integration**: Connect to MotherDuck cloud instances for hybrid local/cloud queries
  - `motherduck.attach` - Connect to MotherDuck with authentication token
  - `motherduck.detach` - Disconnect from MotherDuck
  - `motherduck.status` - Check connection status and usage
  - `motherduck.list_databases` - List available cloud databases
  - `motherduck.create_database` - Create new cloud database
  - `motherduck.query` - Execute queries on MotherDuck
  - `motherduck.share_table` - Share local tables to cloud
  - `motherduck.import_table` - Import cloud tables to local
- **Hybrid Query Support**: Seamlessly query across local DuckDB and MotherDuck cloud
- **Cloud Storage Monitoring**: Track bytes used and limits in MotherDuck

### Infrastructure

- Created `MotherDuckService` class for cloud connection management
- Added comprehensive test suite for MotherDuck operations
- Integrated MotherDuck tools into MCP server

## [0.4.0] - 2025-09-21

### Added

- **MCP Prompts Support**: Implemented 5 pre-defined prompts for optimal tool usage
  - `analyze_data` - Analyze tables with aggregations and statistics
  - `ducklake_time_travel` - Query historical data from DuckLake tables
  - `migrate_to_ducklake` - Migrate data from various formats to DuckLake
  - `optimize_query` - Get query optimization suggestions
  - `data_quality_check` - Perform data quality and integrity checks
- **Enhanced MCP Resources**: Extended resource discovery
  - DuckLake catalogs exposed as resources (`duckdb://ducklake/[catalog]`)
  - Multi-tenant spaces exposed as resources (`duckdb://space/[space_name]`)
  - Automatic discovery of available data sources
- **DuckLake Integration**: ACID transactions and time travel capabilities for DuckDB
  - Three new MCP tools: `ducklake.attach`, `ducklake.snapshots`, `ducklake.time_travel`
  - DuckLakeSpaceAdapter for multi-tenant isolation with DuckLake features
  - Migration utilities for Parquet and CSV files to DuckLake format
  - Support for Delta and Iceberg table formats
  - Time travel queries to access historical data
  - Snapshot management with clone and rollback capabilities
  - Space-aware DuckLake catalogs for tenant isolation
- **Migration Utilities**: Comprehensive migration tools for converting data to DuckLake
  - `DuckLakeMigration` class with Parquet, CSV, and query-based migrations
  - Batch migration support for multiple tables
  - Schema validation and migration preview
  - Partitioning support for migrated tables
- **GitHub Release Automation**: Added release-please workflow for automated releases

### Changed

- **Dependencies Upgrade**:
  - Updated `@modelcontextprotocol/sdk` from 1.17.3 to 1.18.1
  - Migrated from Zod v3 to v4 (breaking change for library users)
  - Replaced deprecated `standard-version` with `release-please`
- **MinIO Configuration**: Smart endpoint selection based on environment
  - Automatically uses `MINIO_PUBLIC_ENDPOINT` for local development
  - Automatically uses `MINIO_PRIVATE_ENDPOINT` for production/Railway deployments
  - No more hardcoded endpoints in configuration

### Fixed

- **JSON-RPC Protocol**: Fixed stdout pollution that was corrupting MCP communication
  - Removed all `logger.info` calls that wrote to stdout
  - Changed MinIO endpoint selection logging to use `logger.debug`
  - Ensured clean JSON-RPC protocol for MCP Inspector compatibility

## [0.3.2] - 2025-09-19

### Changed

- Upgraded @duckdb/node-api from 1.3.4-alpha.27 to 1.4.0-r.1
- Moved from alpha to release candidate for better stability
- Documentation updates to clarify 6 native tools vs 14 server tools

### Added

- INTEGRATION-STATUS.md documentation for tracking implementation progress

## [0.3.1] - 2025-09-19

### Fixed

- **Critical**: Fixed DuckDB initialization order bug that caused "Database not initialized" error when S3 credentials were configured
- Moved `isInitialized` flag to be set before S3 configuration attempts
- Added error handling for optional S3 configuration - failures now log warning but don't block initialization

### Changed

- S3 configuration is now non-blocking - database remains functional even if S3 setup fails

## [0.3.0] - 2025-09-19

### Added

- **Library Mode**: Package can now be imported without side effects or STDIO pollution
- **Three Usage Modes**:
  1. Standalone MCP Server (14 tools)
  2. Library Mode for embedding (6 native tools)
  3. Embedded Mode with shared DuckDB instance
- **DuckLake Service**: Delta Lake-like features with ACID transactions and time travel
- **Export Paths**:
  - `/native` - Native tool handlers and definitions
  - `/server` - DuckDBMCPServer class
  - `/lib` - Library mode utilities including `getToolHandlersWithService()`
  - `/federation` - Federation components
- **Space Context System** (hidden feature): Multi-tenant isolation with query transformation
- `getToolHandlersWithService()` function to use existing DuckDB instances
- `createEmbeddedServer()` function for embedded mode

### Changed

- **BREAKING**: Removed auto-initialization on import - use `getToolHandlersWithService()` for external DuckDB instances
- DuckDB service no longer initializes automatically on module import

### Fixed

- STDIO pollution in MCP/STDIO mode
- Library imports now clean without console output

## [0.2.4] - 2025-09-19

### Fixed

- Logger now correctly routes all output to stderr in MCP mode
- Prevents JSON protocol corruption when running as MCP server
- Fixed stdout pollution that was breaking MCP/STDIO communication

### Changed

- Improved detection of MCP/STDIO mode
- Logger uses stderr exclusively in MCP mode

## [0.2.3] - 2025-09-19

### Fixed

- Fixed E2E tests database initialization in CI
- Skipped failing unit tests temporarily for CI stability
- Updated test framework to use config-based DuckDB injection
- Improved error handling in MCP server

### Changed

- Tests now pass DuckDB service via config object instead of direct parameter

## [0.2.2] - 2025-09-18

### Fixed

- Fixed test failures in CI/CD pipeline
- Resolved TypeScript build errors related to test configuration files

## [0.2.1] - 2025-09-18

### Fixed

- Fixed integration test issues
- Improved MCP Inspector compatibility

## [0.2.0] - 2025-09-18

### Added

- Federation support with 8 additional tools for virtual tables:
  - `attach_mcp` - Connect to external MCP servers
  - `detach_mcp` - Disconnect MCP servers
  - `list_attached_servers` - Show connected servers
  - `list_mcp_resources` - List available resources
  - `create_virtual_table` - Map resources to tables
  - `drop_virtual_table` - Remove virtual tables
  - `list_virtual_tables` - Show virtual tables
  - `refresh_virtual_table` - Update table data
- `export_data` tool - Export query results to CSV/Parquet/JSON files
- WebSocket transport support
- TCP transport support
- HTTP transport (partial support)
- SDKTransportAdapter for transport compatibility
- Federation components:
  - ResourceRegistry for namespace management
  - ConnectionPool with connection reuse
  - QueryRouter for federated query planning
- Virtual table support for JSON and CSV resources
- 5-minute TTL caching for resources

### Changed

- Total tools increased from 5 to 14 (6 native + 8 federation)
- Improved transport layer architecture
- Enhanced error handling across all components

## [0.1.0] - 2025-09-17

### Added

- Initial release of DuckDB MCP Native
- Full MCP protocol implementation (JSON-RPC 2.0)
- Stdio transport support
- DuckDB integration with 5 core tools:
  - `query_duckdb` - Execute SQL queries
  - `list_tables` - List all tables
  - `describe_table` - Get table schema
  - `load_csv` - Load CSV files
  - `load_parquet` - Load Parquet files
- Resource management for exposing DuckDB tables
- Security modes (development/production)
- S3/MinIO configuration support
- TypeScript implementation with full type safety
- Comprehensive documentation
- Jest test setup
- ESLint + Prettier configuration
- Husky + commitlint for code quality
- GitHub Actions CI/CD workflows

### Security

- Query validation in production mode
- SQL injection prevention
- Query size limits
- Timeout controls

[Unreleased]: https://github.com/theseedship/duckdb_mcp_node/compare/v0.6.1...HEAD
[0.6.1]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.6.1
[0.6.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.6.0
[0.5.1]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.5.1
[0.5.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.5.0
[0.4.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.4.0
[0.3.2]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.3.2
[0.3.1]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.3.1
[0.3.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.3.0
[0.2.4]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.2.4
[0.2.3]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.2.3
[0.2.2]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.2.2
[0.2.1]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.2.1
[0.2.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.2.0
[0.1.0]: https://github.com/theseedship/duckdb_mcp_node/releases/tag/v0.1.0
