fix(mcp): enforce tool name validation in deploy modal#4879
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Client rules mirror the persisted shape: lowercase alphanumerics with single underscores between segments, no leading/trailing or doubled underscores, max 64 characters. Invalid names show an inline error and error styling on the input, Save stays disabled via Reviewed by Cursor Bugbot for commit 2979b35. Configure here. |
Greptile SummaryThis PR enforces client-side validation on the MCP "Tool name" field to prevent the server from silently rewriting the user's input via
Confidence Score: 5/5Safe to merge — a self-contained client-side validation addition with no changes to server logic or data flow. The change is narrowly scoped to a single UI component: it adds a regex guard and length cap, wires them into existing save/enable gates, and surfaces feedback inline. The chosen pattern exactly mirrors the server's sanitization output, so the name the user sees is the name the server will persist. No state, store, or API contract is altered. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User types in Tool Name input] --> B{Name is empty?}
B -- Yes --> C[No error, save blocked by empty guard\nCombobox disabled]
B -- No --> D{Length over 64?}
D -- Yes --> E[Error: must be 64 chars or fewer\nRed border shown, combobox disabled]
D -- No --> F{Matches valid pattern?}
F -- No --> G[Error: use lowercase letters and numbers\nRed border shown, combobox disabled with hint]
F -- Yes --> H[No error, combobox enabled]
H --> I{Has unsaved changes?}
I -- Yes --> J[Save button enabled]
I -- No --> K[Save button disabled]
J --> L[handleSave sends to server]
Reviews (2): Last reviewed commit: "fix(mcp): align tool-name regex with ser..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2979b35. Configure here.
Summary
epic-sun3 3) saved silently, then the server rewrote it toepic_sun3_3, so the persisted name differed from what the user typedType of Change
Testing
Tested manually
Checklist