Delete deletes an MCP server
(c *gin.Context)
| 255 | |
| 256 | // Delete deletes an MCP server |
| 257 | func (h *MCPHandler) Delete(c *gin.Context) { |
| 258 | ctx := c.Request.Context() |
| 259 | id := c.Param("id") |
| 260 | |
| 261 | if err := (*h.store).Delete(ctx, "mcp_servers", id); err != nil { |
| 262 | if errors.Is(err, store.ErrNotFound) { |
| 263 | c.JSON(http.StatusNotFound, gin.H{ |
| 264 | "success": false, |
| 265 | "error": gin.H{ |
| 266 | "code": "not_found", |
| 267 | "message": "MCP server not found", |
| 268 | }, |
| 269 | }) |
| 270 | return |
| 271 | } |
| 272 | c.JSON(http.StatusInternalServerError, gin.H{ |
| 273 | "success": false, |
| 274 | "error": gin.H{ |
| 275 | "code": "internal_error", |
| 276 | "message": err.Error(), |
| 277 | }, |
| 278 | }) |
| 279 | return |
| 280 | } |
| 281 | |
| 282 | logging.Info(ctx, "mcp.server.deleted", map[string]any{ |
| 283 | "id": id, |
| 284 | }) |
| 285 | |
| 286 | c.Status(http.StatusNoContent) |
| 287 | } |
| 288 | |
| 289 | // Connect connects to an MCP server (start) |
| 290 | func (h *MCPHandler) Connect(c *gin.Context) { |