fix(mcp-server): fix DuckDB connection info and Dockerfile caching#1461
fix(mcp-server): fix DuckDB connection info and Dockerfile caching#1461goldmedal merged 2 commits intoCanner:mainfrom
Conversation
…connection DuckDB connection info requires `format: "duckdb"` but the Web UI was not sending it. Add it as a hidden field with a fixed value. Also rename the label to "Directory Path" with a hint clarifying it is not a .duckdb file path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nv comments Use BuildKit cache mounts for poetry cache/artifacts to speed up rebuilds. Remove redundant inline comments for env vars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces hidden form field support to the MCP server template system, updates the DuckDB datasource configuration to use directory paths instead of file paths, and optimizes Docker builds with Poetry cache mounts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
mcp-server/app/templates/_fields.html (1)
5-5: Preserve existing hidden values when re-rendering forms.Line 5 currently ignores persisted
connection_infoand always uses the field default, which can silently overwrite hidden values on update flows.Suggested patch
- <input type="hidden" name="{{ field.name }}" value="{{ field.get('value', '') }}"> + <input type="hidden" name="{{ field.name }}" value="{{ connection_info.get(field.name, field.get('value', '')) }}">🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mcp-server/app/templates/_fields.html` at line 5, The hidden input always uses field.get('value', '') which overwrites persisted connection_info on re-render; change the template to prefer any submitted/form value first (e.g. use request.form.get(field.name, field.get('value', '')) or the framework's equivalent) so existing hidden values are preserved when the form is re-rendered; update the value expression for the input whose name is {{ field.name }} to read from form/request data with a fallback to field.get('value', '').
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@mcp-server/app/web.py`:
- Line 41: The dictionary literal for the DUCKDB field (the dict with keys
"name": "url", "label": "Directory Path", "type": "text", "placeholder":
"/data", "hint": "Path to a directory containing .duckdb files, not the .duckdb
file itself.") exceeds the 88-char line limit; reformat that dict in web.py so
each key/value pair is on its own line (or otherwise wrapped with implicit line
continuation inside the braces) to keep lines ≤88 chars and preserve the same
keys/values and order.
- Around line 41-42: When saving/updating connections in post_connection, detect
legacy payloads that use "path" and normalize them to "url" so existing saved
DuckDB locations are not dropped on re-save: if the incoming connection dict has
no "url" but has "path", copy/rename that value into "url" before
validation/storage; additionally enforce the hidden format server-side by
setting connection["format"] = "duckdb" unconditionally for DuckDB-type
connections (do this in post_connection before any client-driven validation or
persistence) so clients cannot omit or override the format.
---
Nitpick comments:
In `@mcp-server/app/templates/_fields.html`:
- Line 5: The hidden input always uses field.get('value', '') which overwrites
persisted connection_info on re-render; change the template to prefer any
submitted/form value first (e.g. use request.form.get(field.name,
field.get('value', '')) or the framework's equivalent) so existing hidden values
are preserved when the form is re-rendered; update the value expression for the
input whose name is {{ field.name }} to read from form/request data with a
fallback to field.get('value', '').
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7b3c7409-b2d8-4ec1-a97a-c9b1298b9863
📒 Files selected for processing (3)
ibis-server/Dockerfilemcp-server/app/templates/_fields.htmlmcp-server/app/web.py
…anner#1461) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
format: "duckdb"hidden field to DuckDB connection info in the Web UI — this field is required but was not being senturllabel to "Directory Path" with a hint clarifying it points to a directory, not a.duckdbfileTest plan
formatfield is included in the submitted connection info🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Changes
Chores