feat: add Go MCP server delete API (#15262)

## What

#15240
Implementation for DELETE /api/v1/mcp/servers/:mcp_id
This commit is contained in:
Alexander Laurent
2026-05-29 01:29:55 -10:00
committed by GitHub
parent 09e91a8e61
commit faa9c5469e
5 changed files with 115 additions and 4 deletions

View File

@@ -63,3 +63,24 @@ func (h *MCPHandler) CreateMCPServer(c *gin.Context) {
"data": result,
})
}
// DeleteMCPServer deletes an MCP server for the current user.
func (h *MCPHandler) DeleteMCPServer(c *gin.Context) {
user, errorCode, errorMessage := GetUser(c)
if errorCode != common.CodeSuccess {
jsonError(c, errorCode, errorMessage)
return
}
result, code, err := h.mcpService.DeleteMCPServer(user.ID, c.Param("mcp_id"))
if err != nil {
jsonError(c, code, err.Error())
return
}
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": "success",
"data": result,
})
}