Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const headers = { | ||
| Accept: "application/json", | ||
| "Content-Type": "application/json", | ||
| Authorization: `ApiKey ${getApiKey()}`, |
There was a problem hiding this comment.
Incorrect Accept header for text export requests
Low Severity
The apiRequestText function sets Accept: "application/json" but is specifically used for text export endpoints (/export/text, /export/code, /export/mermaid). Requesting JSON content type when expecting plain text responses is semantically incorrect and could cause issues if the API strictly validates Accept headers.
| } | ||
|
|
||
| throw new Error("Unexpected error in apiRequestText"); | ||
| } |
There was a problem hiding this comment.
Duplicated API request functions with identical retry logic
Medium Severity
The apiRequest and apiRequestText functions contain nearly identical implementations spanning ~70 lines each. Both share the same URL construction, header setup, retry loop, AbortController management, and error handling. The only difference is that one returns response.json() and the other returns response.text(). This duplication means any bug fix or enhancement to retry/timeout logic must be manually replicated in both places, increasing maintenance burden and risk of inconsistencies.
I wired up flow reads, including text/code/Mermaid exports, so MCP can pull flow data cleanly.
What I changed
Why I did it
Notes
Test plan
Note
Medium Risk
Adds new API client surface area and multiple MCP tools that call external IcePanel endpoints (including export endpoints), plus retry/timeout/env validation logic that could affect runtime behavior if misconfigured.
Overview
Adds a new
icepanel-clientservice that centralizes IcePanel API calls with configurable base URL, timeouts, and retry/backoff, plus structuredIcePanelApiErrorhandling and filter-to-query serialization.Introduces new MCP tools for flow reads:
icepanel_list_flows(with optional fuzzysearch),icepanel_get_flow,icepanel_list_flow_thumbnails,icepanel_get_flow_thumbnail, and flow export readers for text/code/Mermaid, and wires them intoregisterAllTools.Extends
src/types.tswith flow/diagram/tag/domain request/response shapes (and broadensModelObjectunions) to support the new endpoints.Written by Cursor Bugbot for commit 1d3e6cf. This will update automatically on new commits. Configure here.
Recommended merge order