MCPcopy Create free account
hub / github.com/astercloud/aster / Delete

Method Delete

server/handlers/mcp.go:257–287  ·  view source on GitHub ↗

Delete deletes an MCP server

(c *gin.Context)

Source from the content-addressed store, hash-verified

255
256// Delete deletes an MCP server
257func (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)
290func (h *MCPHandler) Connect(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

InfoFunction · 0.92
JSONMethod · 0.80
ContextMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected