-
Notifications
You must be signed in to change notification settings - Fork 614
fix: mcp args with space #1114 #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe MCP server form was refactored to replace space-separated single-string argument handling with a line-by-line list model ( Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Form as mcpServerForm.vue
participant State as Component State
participant Parser as Config Parser
User->>Form: Open/Edit server form
Form->>Parser: Parse initialConfig / defaultJsonConfig
alt buildInFileSystem
Parser->>State: Populate foldersList (from args)
else imageServer / standard
Parser->>State: Populate argsRows[] (each row with nanoid)
end
User->>Form: Add Arg
Form->>State: create argsRow(id)
User->>Form: Edit Arg row
Form->>State: update argsRows[i].value
User->>Form: Remove Arg
Form->>State: remove argsRows[i]
User->>Form: Submit
Form->>Parser: handleSubmit()
alt buildInFileSystem
State->>Parser: join foldersList with newline -> normalized args
else standard/imageServer
State->>Parser: join argsRows.values with newline -> normalized args
else remote (SSE/HTTP)
State->>Parser: set args empty/default
end
Parser-->>Form: return normalized config
Form->>User: save/close
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
src/renderer/src/components/mcp-config/mcpServerForm.vue(11 hunks)src/renderer/src/i18n/en-US/mcp.json(1 hunks)src/renderer/src/i18n/en-US/settings.json(1 hunks)src/renderer/src/i18n/fa-IR/mcp.json(1 hunks)src/renderer/src/i18n/fa-IR/settings.json(1 hunks)src/renderer/src/i18n/fr-FR/mcp.json(1 hunks)src/renderer/src/i18n/fr-FR/settings.json(1 hunks)src/renderer/src/i18n/ja-JP/mcp.json(1 hunks)src/renderer/src/i18n/ja-JP/settings.json(1 hunks)src/renderer/src/i18n/ko-KR/mcp.json(1 hunks)src/renderer/src/i18n/ko-KR/settings.json(1 hunks)src/renderer/src/i18n/pt-BR/mcp.json(1 hunks)src/renderer/src/i18n/pt-BR/settings.json(1 hunks)src/renderer/src/i18n/ru-RU/mcp.json(1 hunks)src/renderer/src/i18n/ru-RU/settings.json(1 hunks)src/renderer/src/i18n/zh-CN/mcp.json(1 hunks)src/renderer/src/i18n/zh-CN/settings.json(1 hunks)src/renderer/src/i18n/zh-HK/mcp.json(1 hunks)src/renderer/src/i18n/zh-HK/settings.json(1 hunks)src/renderer/src/i18n/zh-TW/mcp.json(1 hunks)src/renderer/src/i18n/zh-TW/settings.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-check (x64)
🔇 Additional comments (27)
src/renderer/src/i18n/ko-KR/mcp.json (1)
40-43: ✓ Localization update for per-line argument inputThe Korean translations align with the PR's shift from space-separated to line-based argument input. Keys and values are consistent with the broader localization pattern across other locales.
src/renderer/src/i18n/zh-TW/settings.json (1)
623-625: ✓ Localization update for per-line argument inputThe Traditional Chinese translations correctly reflect the new per-line argument input pattern. New keys (
addArg,argPlaceholder) and updatedargsPlaceholdertext are consistent with the UI refactor.src/renderer/src/i18n/zh-HK/settings.json (1)
624-626: ✓ Localization update for per-line argument inputThe Cantonese (Hong Kong) translations correctly reflect the new per-line argument input pattern. New keys and updated placeholder text align with the UI refactor across locales.
src/renderer/src/i18n/ko-KR/settings.json (1)
624-626: ✓ Localization update for per-line argument inputThe Korean translations in settings.json align with the per-line argument input pattern. Keys and values are consistent across both mcp.json and settings.json files.
src/renderer/src/i18n/zh-HK/mcp.json (1)
84-86: ✓ Localization update for per-line argument inputThe Cantonese (Hong Kong) translations correctly reflect the new per-line argument input pattern. Keys and values are consistent with the UI refactor.
src/renderer/src/i18n/zh-TW/mcp.json (1)
65-67: ✓ Localization update for per-line argument inputThe Traditional Chinese translations correctly reflect the new per-line argument input pattern. Keys and values align with the UI refactor across locales.
src/renderer/src/i18n/ru-RU/mcp.json (1)
84-86: ✓ Localization update for per-line argument inputThe Russian translations correctly reflect the new per-line argument input pattern. Keys and values are consistent with the UI refactor across locales.
src/renderer/src/i18n/ru-RU/settings.json (1)
624-626: RU i18n: args UI keys added and phrasing looks correct.src/renderer/src/i18n/zh-CN/settings.json (1)
632-635: ZH-CN i18n: keys present; wording concise and correct.src/renderer/src/i18n/zh-CN/mcp.json (1)
65-68: ZH-CN i18n: per-line args + addArg/argPlaceholder aligned; looks good.src/renderer/src/i18n/ja-JP/mcp.json (1)
84-87: JA i18n: keys added; phrasing natural (1行に1つ...).src/renderer/src/i18n/fr-FR/settings.json (1)
624-627: FR settings i18n: mirrors MCP file; OK.src/renderer/src/i18n/ja-JP/settings.json (1)
623-626: JA settings i18n: per-line args + addArg/argPlaceholder OK.src/renderer/src/i18n/pt-BR/settings.json (1)
633-635: LGTM!The Portuguese translations for the new per-argument input UI are consistent with the English source and align with the UI changes in the Vue component.
src/renderer/src/i18n/en-US/settings.json (1)
633-635: LGTM!The new i18n keys clearly communicate the per-line argument input paradigm, which properly addresses the issue with arguments containing spaces.
src/renderer/src/i18n/en-US/mcp.json (1)
84-86: LGTM!The MCP-specific locale keys are consistent with the settings.json translations and properly support the new argument input UI.
src/renderer/src/i18n/pt-BR/mcp.json (1)
84-86: LGTM!Portuguese translations are consistent with the settings.json counterpart and properly localized.
src/renderer/src/components/mcp-config/mcpServerForm.vue (10)
31-31: LGTM!Good choice using
nanoidfor generating unique IDs for argument rows. This ensures stable keys for Vue's list rendering.
52-52: LGTM!Correctly initializes
argswith newline-separated values to match the new per-line input format.
98-104: LGTM!Clean integration with the new
setArgsRowsFromArrayhelper for setting image model arguments.
192-205: LGTM!Good defensive handling with
Array.isArraycheck and proper branching forbuildInFileSystemvs standard argument parsing.
320-346: Well-structured argument row management.The
syncArgsRowsFromStringfunction includes a smart optimization to skip updates when values haven't changed, preventing unnecessary re-renders. The ID-based approach withnanoidensures stable Vue list rendering.
378-415: Good mutual synchronization with loop prevention.The watchers correctly synchronize between
args,argsRows, andfoldersListwith guards to prevent infinite loops. The check at line 401 (args.value !== joinedArgs) and the early return insyncArgsRowsFromString(lines 330-335) work together to break potential cycles.
493-499: LGTM!Proper normalization that filters out empty arguments before submission, ensuring clean server configuration.
612-632: LGTM!The watch correctly extracts provider and model ID from the new
argsRowsstructure, with proper filtering of empty values before parsing.
644-656: LGTM!Consistent handling with the JSON parsing logic, properly initializing
argsRowsorfoldersListbased on server type.
947-968: Clean UI implementation for per-argument input.The implementation provides good UX with:
- Scrollable container (
max-h-48 overflow-y-auto) to handle many arguments- Clear add/remove actions per row
- Hidden input preserving the
argsv-model for existing logicThe design properly addresses the original issue of arguments containing spaces.
fixed #1114
Summary by CodeRabbit
New Features
Documentation / Localization
✏️ Tip: You can customize this high-level summary in your review settings.