feat(lightspeed): add MCP servers settings panel#2657
feat(lightspeed): add MCP servers settings panel#2657ciiay wants to merge 17 commits intoredhat-developer:mainfrom
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Implement WIP token configuration modal behaviors for MCP servers, including saved-token revisit, debounced validation feedback, and status-specific UI states to unblock frontend integration work. Made-with: Cursor
Signed-off-by: Yi Cai <yicai@redhat.com>
b75aef3 to
23e4633
Compare
Review Summary by QodoAdd MCP servers settings panel with token configuration and validation
WalkthroughsDescription• Add MCP servers settings panel with token configuration UI • Implement debounced token validation with inline feedback • Support dual auth header formats (raw token and Bearer prefix) • Add backend endpoints for server management and validation • Integrate settings modal into chat interface with fullscreen support Diagramflowchart LR
A["User opens MCP settings"] --> B["Load configured servers"]
B --> C["Display servers table"]
C --> D["User edits server token"]
D --> E["Debounced validation"]
E --> F["Show success/error feedback"]
F --> G["User saves token"]
G --> H["Backend persists token"]
H --> I["Validate server connection"]
File Changes1. workspaces/lightspeed/plugins/lightspeed-backend/src/service/mcp-server-validator.ts
|
Code Review by Qodo
1. Cannot forget MCP token
|
| <Button | ||
| key="save" | ||
| variant="primary" | ||
| onClick={() => void saveServerToken()} | ||
| isDisabled={ | ||
| !canManageMcp || | ||
| Boolean(isSaving[editingServer?.name ?? '']) || | ||
| tokenValidationState === 'validating' || | ||
| !tokenInputValue.trim() | ||
| } | ||
| className={classes.modalActionButton} | ||
| > | ||
| Save | ||
| </Button> | ||
| {hasSavedTokenInModal && ( | ||
| <Button | ||
| key="forget-token" | ||
| variant="plain" | ||
| onClick={forgetSavedToken} | ||
| className={classes.forgetTokenButton} | ||
| > | ||
| Forget token | ||
| </Button> | ||
| )} |
There was a problem hiding this comment.
1. Cannot forget mcp token 🐞 Bug ≡ Correctness
In McpServersSettings, clicking “Forget token” only clears local state and the Save button is disabled when the token input is empty, so users cannot persistently remove a previously saved token (i.e., submit token:null). This leaves users stuck with stored credentials they cannot delete via the UI.
Agent Prompt
## Issue description
Users cannot delete a previously saved MCP token from the settings modal. The UI disables the Save button when the token field is empty, and the “Forget token” button only clears local component state without persisting `token: null` to the backend.
## Issue Context
Backend persistence supports clearing tokens by sending `token: null` (store upsert preserves null and resets status). The frontend already builds a PATCH payload that would send `token: null`, but the Save button is disabled when the input is empty, making the token-removal path unreachable.
## Fix Focus Areas
- workspaces/lightspeed/plugins/lightspeed/src/components/McpServersSettings.tsx[792-798]
- workspaces/lightspeed/plugins/lightspeed/src/components/McpServersSettings.tsx[1122-1131]
- workspaces/lightspeed/plugins/lightspeed/src/components/McpServersSettings.tsx[854-873]
## Suggested fix
- Make “Forget token” actually persist the deletion by calling `patchServer(editingServer.name, { token: null })` (and optionally re-validate / close modal).
- Alternatively (or additionally), allow Save when clearing a token (e.g., only require non-empty input when creating/updating a token, but allow empty to mean delete), so `saveServerToken()` can submit `token: null`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
|



Hey, I just made a Pull Request!
For RHIDP-12079
✔️ Checklist
Screen recording:
rhidp_12079.mp4